Lines Matching refs:ptr
38 static void PrintBinary(u8* ptr, int len);
94 void* ptr; in MyAlloc() local
96 ptr = OS_Alloc(size+4); in MyAlloc()
97 *(u32*)ptr = size; in MyAlloc()
98 (u8*)ptr += 4; in MyAlloc()
100 OS_TPrintf("Allocate %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyAlloc()
102 ptr = OS_Alloc(size); in MyAlloc()
104 return ptr; in MyAlloc()
112 static void MyFree(void* ptr) in MyFree() argument
116 (u8*)ptr -= 4; in MyFree()
117 size = *(u32*)ptr; in MyFree()
119 OS_TPrintf("Free %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyFree()
121 OS_Free(ptr); in MyFree()
133 static void* MyRealloc(void* ptr, u32 new_size, u32 old_size) in MyRealloc() argument
143 … OS_TPrintf("Reallocate %d bytes from %p: total %d bytes\n", new_size, ptr, total_allocated_size); in MyRealloc()
145 (u8*)ptr -= 4; in MyRealloc()
146 size = *(u32*)ptr; in MyRealloc()
148 …OS_TPrintf("Free(for realloc) %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size… in MyRealloc()
150 OS_Free(ptr); in MyRealloc()
157 MI_CpuCopy8(ptr, buf, MIN(new_size, old_size)); in MyRealloc()
158 OS_Free(ptr); in MyRealloc()
446 static void PrintBinary(u8* ptr, int len) in PrintBinary() argument
456 OS_TPrintf("%02x", ptr[i]); in PrintBinary()
459 #pragma unused(ptr,len) in PrintBinary()