VG_STATIC void vg_error(const char *fmt, ...);
VG_STATIC void vg_info(const char *fmt, ...);
+VG_STATIC u32 vg_align8( u32 s )
+{
+ u32 m = (s + 7) >> 3;
+ return m << 3;
+}
+
/* Returns allocator structure from data pointer */
static vg_linear_allocator *vg_linear_header( void *data )
{
__attribute__((warn_unused_result))
VG_STATIC void *vg_linear_alloc( void *buffer, u32 size )
{
+ if( size % 8 )
+ {
+ vg_error( "Requested size: %u\n", size );
+ vg_fatal_exit_loop( "8 byte alignment required" );
+ }
+
vg_linear_allocator *alloc = vg_linear_header( buffer );
if( (alloc->cur + size) > alloc->size )