struct vg_linear_allocator
{
u32 size;
- /* */
- /* */
- /* */
u32 cur;
- /* */
- /* */
- /* */
u16 allocation_count;
- /* */
u16 flags;
- /* */
u32 last_alloc_size;
- /* */
- /* */
- /* */
void *last_alloc;
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
vg_allocation_meta *alloc_table;
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
#ifdef _WIN32
/* 32 bit pointers! */
{
vg_linear_allocator *alloc = vg_linear_header( buffer );
- if( alloc->last_alloc != data )
- vg_fatal_error( "This block has been fixed!" );
+ if( alloc->last_alloc != data ){
+ vg_fatal_error( "This block has been fixed! Last alloc: %p, this: %p\n",
+ alloc->last_alloc, data );
+ }
if( vg_mem.use_libc_malloc && (alloc->flags & VG_MEMORY_SYSTEM) ){
vg_allocation_meta *meta = &alloc->alloc_table[alloc->allocation_count-1];
}
alloc->cur += block_size;
- alloc->last_alloc = NULL; /* cant resize this block! */
+ alloc->last_alloc = header;
alloc->last_alloc_size = block_size;
-
alloc->allocation_count ++;
}
else{