Lines Matching refs:p_Block
48 #define ALIGN_BLOCK(p_Block, prefixSize, alignment) \
50 p_Block += (prefixSize); \
51 p_Block += PAD_ALIGNMENT((alignment), (uintptr_t)(p_Block)); \
67 uint8_t *p_Block;
77 p_Block = p_Mem->p_BlocksStack[p_Mem->current];
84 return (void *)p_Block;
88 static __inline__ t_Error MemPut(t_MemorySegment *p_Mem, void *p_Block)
96 p_Mem->p_BlocksStack[p_Mem->current] = (uint8_t *)p_Block;
122 static t_Error DebugMemGet(t_Handle h_Mem, void *p_Block, uintptr_t ownerAddress)
134 (((uint8_t *)p_Block - (p_Mem->p_Bases[0] + p_Mem->blockOffset)) / p_Mem->blockSize);
138 blockIndex = *(uint32_t *)((uint8_t *)p_Block - 4);
150 static t_Error DebugMemPut(t_Handle h_Mem, void *p_Block)
161 (((uint8_t *)p_Block - (p_Mem->p_Bases[0] + p_Mem->blockOffset)) / p_Mem->blockSize);
166 ("Freed address (0x%08x) does not belong to this pool", p_Block));
171 blockIndex = *(uint32_t *)((uint8_t *)p_Block - 4);
176 ("Freed address (0x%08x) does not belong to this pool", p_Block));
187 if (p_Temp != p_Block)
190 ("Freed address (0x%08x) does not belong to this pool", p_Block));
197 ("Attempt to free unallocated address (0x%08x)", p_Block));
517 uint8_t *p_Block = (uint8_t *)
519 if (!p_Block)
526 p_Mem->p_Bases[i] = p_Block;
529 ALIGN_BLOCK(p_Block, prefixSize, alignment);
534 if (p_Block == p_Mem->p_Bases[i])
535 p_Block += alignment;
537 *(uint32_t *)(p_Block - 4) = i;
540 p_Mem->p_BlocksStack[i] = p_Block;
620 uint8_t *p_Block;
632 if ((p_Block = (uint8_t *)MemGet(p_Mem)) == NULL)
639 DebugMemGet(p_Mem, p_Block, callerAddr);
643 return (void *)p_Block;
689 t_Error MEM_Put(t_Handle h_Mem, void *p_Block)
699 if ((rc = MemPut(p_Mem, p_Block)) != E_OK)
706 DebugMemPut(p_Mem, p_Block);
721 uint8_t *p_Block;
733 p_Block = ((p_Mem->p_Bases[0] + p_Mem->blockOffset) +
737 p_Block, p_MemDbg[i].ownerAddress);
748 p_Block = p_Mem->p_Bases[i];
750 ALIGN_BLOCK(p_Block, p_Mem->prefixSize, p_Mem->alignment);
752 if (p_Block == p_Mem->p_Bases[i])
753 p_Block += p_Mem->alignment;
756 p_Block, p_MemDbg[i].ownerAddress);