Lines Matching refs:ptr
39 static void PrintBinary(u8* ptr, int len);
95 void* ptr; in MyAlloc() local
97 ptr = OS_Alloc(size+4); in MyAlloc()
98 *(u32*)ptr = size; in MyAlloc()
99 (u8*)ptr += 4; in MyAlloc()
101 OS_TPrintf("Allocate %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyAlloc()
103 ptr = OS_Alloc(size); in MyAlloc()
105 return ptr; in MyAlloc()
113 static void MyFree(void* ptr) in MyFree() argument
117 (u8*)ptr -= 4; in MyFree()
118 size = *(u32*)ptr; in MyFree()
120 OS_TPrintf("Free %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyFree()
122 OS_Free(ptr); in MyFree()
134 static void* MyRealloc(void* ptr, u32 new_size, u32 old_size) in MyRealloc() argument
144 … OS_TPrintf("Reallocate %d bytes from %p: total %d bytes\n", new_size, ptr, total_allocated_size); in MyRealloc()
146 (u8*)ptr -= 4; in MyRealloc()
147 size = *(u32*)ptr; in MyRealloc()
149 …OS_TPrintf("Free(for realloc) %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size… in MyRealloc()
151 OS_Free(ptr); in MyRealloc()
158 MI_CpuCopy8(ptr, buf, MIN(new_size, old_size)); in MyRealloc()
159 OS_Free(ptr); in MyRealloc()
450 static void PrintBinary(u8* ptr, int len) in PrintBinary() argument
460 OS_TPrintf("%02x", ptr[i]); in PrintBinary()
463 #pragma unused(ptr,len) in PrintBinary()