Lines Matching refs:ptr
35 static void PrintBinary(u8* ptr, int len);
127 void* ptr; in MyAlloc() local
129 ptr = OS_Alloc(size+4); in MyAlloc()
130 *(u32*)ptr = size; in MyAlloc()
131 (u8*)ptr += 4; in MyAlloc()
133 OS_TPrintf("Allocate %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyAlloc()
135 ptr = OS_Alloc(size); in MyAlloc()
137 return ptr; in MyAlloc()
145 static void MyFree(void* ptr) in MyFree() argument
149 (u8*)ptr -= 4; in MyFree()
150 size = *(u32*)ptr; in MyFree()
152 OS_TPrintf("Free %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size); in MyFree()
154 OS_Free(ptr); in MyFree()
166 static void* MyRealloc(void* ptr, u32 new_size, u32 old_size) in MyRealloc() argument
176 … OS_TPrintf("Reallocate %d bytes from %p: total %d bytes\n", new_size, ptr, total_allocated_size); in MyRealloc()
178 (u8*)ptr -= 4; in MyRealloc()
179 size = *(u32*)ptr; in MyRealloc()
181 …OS_TPrintf("Free(for realloc) %d bytes from %p: total %d bytes\n", size, ptr, total_allocated_size… in MyRealloc()
183 OS_Free(ptr); in MyRealloc()
190 MI_CpuCopy8(ptr, buf, MIN(new_size, old_size)); in MyRealloc()
191 OS_Free(ptr); in MyRealloc()
454 static void PrintBinary(u8* ptr, int len) in PrintBinary() argument
464 OS_TPrintf("%02x", ptr[i]); in PrintBinary()
467 #pragma unused(ptr,len) in PrintBinary()