msg api, mem api
[vg.git] / vg_mem.c
index 797407913bd65f36d6ef65d077642a004fdda1f4..0efd3adf484f674daf4d1d6a56723f39321266ef 100644 (file)
--- a/vg_mem.c
+++ b/vg_mem.c
@@ -34,18 +34,16 @@ vg_linear_allocator *vg_linear_header( void *data )
 __attribute__((warn_unused_result))
 void *_vg_linear_alloc( void *buffer, u32 size, const char *constr_name )
 {
-   if( size % 8 ){
-      vg_error( "alloc(%u) is not 8 byte aligned\n", size );
-      vg_print_backtrace();
+   if( size % 8 )
       size = vg_align8( size );
-   }
-   if( ((u64)buffer) % 8 ){
+
+   if( ((u64)buffer) % 8 )
       vg_fatal_error( "unaligned buffer (%p)", buffer );
-   }
 
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
-   if( (alloc->cur + size) > alloc->size ){
+   if( (alloc->cur + size) > alloc->size )
+   {
       vg_fatal_error( "linear allocator overflow (%u + %u > %u)\n", 
                         alloc->cur, size, alloc->size );
    }