|
My lua_Alloc function is:
static void* LuaAllocator( void* ud, void* ptr, size_t osize, size_t nsize )
{
linear_allocator_t* lalloc = (linear_allocator_t*)ud;
void* nptr = 0;
if ( nsize != 0 )
{
if ( osize < nsize )
{
nptr = linear_allocator_malloc( lalloc, nsize );
}
else
{
nptr = ptr;
}
}
printf( "ptr=%p osize=%4u nsize=%4u nptr=%p used=%.8u\n", ptr, osize, nsize, nptr, lalloc->current_offset );
fflush( stdout );
return nptr;
}