Make halloc-based list allocation work without context

darcs-hash:20070224131932-ac50b-4523781b1e3cc49e7cd7e3b2e1f21e28b1c5503f.gz
This commit is contained in:
axel 2007-02-24 23:19:32 +10:00
parent 0f51d5ec18
commit 9b10fa4762

View file

@ -37,7 +37,7 @@ array_list_t *al_halloc( void *context )
if( !res )
DIE_MEM();
al_init( res );
halloc_register_function( context, (void (*)(void *)) &al_destroy, res );
halloc_register_function( context?context:res, (void (*)(void *)) &al_destroy, res );
return res;
}
@ -47,7 +47,7 @@ string_buffer_t *sb_halloc( void *context )
if( !res )
DIE_MEM();
sb_init( res );
halloc_register_function( context, (void (*)(void *)) &sb_destroy, res );
halloc_register_function( context?context:res, (void (*)(void *)) &sb_destroy, res );
return res;
}