Lines Matching refs:ptr
36 static void PrintBinary(u8* ptr, int len);
128 void* ptr; in MyAlloc() local
130 ptr = OS_Alloc(size+4); in MyAlloc()
131 *(u32*)ptr = size; in MyAlloc()
132 (u8*)ptr += 4; in MyAlloc()
134 OS_TPrintf("Allocate %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyAlloc()
136 ptr = OS_Alloc(size); in MyAlloc()
138 return ptr; in MyAlloc()
146 static void MyFree(void* ptr) in MyFree() argument
150 (u8*)ptr -= 4; in MyFree()
151 size = *(u32*)ptr; in MyFree()
153 OS_TPrintf("Free %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyFree()
155 OS_Free(ptr); in MyFree()
167 static void* MyRealloc(void* ptr, u32 new_size, u32 old_size) in MyRealloc() argument
177 … OS_TPrintf("Reallocate %d bytes from %p: total %d bytes\n", new_size, ptr, total_allocated_size); in MyRealloc()
179 (u8*)ptr -= 4; in MyRealloc()
180 size = *(u32*)ptr; in MyRealloc()
182 …OS_TPrintf("Free(for realloc) %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size… in MyRealloc()
184 OS_Free(ptr); in MyRealloc()
191 MI_CpuCopy8(ptr, buf, MIN(new_size, old_size)); in MyRealloc()
192 OS_Free(ptr); in MyRealloc()
458 static void PrintBinary(u8* ptr, int len) in PrintBinary() argument
468 OS_TPrintf("%02x", ptr[i]); in PrintBinary()
471 #pragma unused(ptr,len) in PrintBinary()