-Subproject commit eef4d3c86a653f91b7221c80809ba8ab56f94cf1
+Subproject commit 06492c598158cf825a18aececaf7511d7fd04f48
if( vg_long_opt( "use-libc-malloc" ) )
{
- vg_mem.use_libc_malloc = atoi( arg );
+ vg_mem.use_libc_malloc = 1;
}
if( vg_long_opt( "high-performance" ) )
data_size = length_samples * sizeof(i16);
audio_lock();
- clip->data = vg_linear_alloc( lin_alloc, data_size );
+ clip->data = vg_linear_alloc( lin_alloc, vg_align8(data_size) );
clip->size = length_samples;
audio_unlock();
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 )
/* Alloc RAM default context */
u32 vert_size = vg_uictx.max_verts*sizeof(struct ui_vert),
- inds_size = vg_uictx.max_indices*sizeof(u16);
+ inds_size = vg_align8( vg_uictx.max_indices*sizeof(u16) );
vg_uictx.vertex_buffer = vg_linear_alloc( vg_mem.rtmemory, vert_size );
vg_uictx.indice_buffer = vg_linear_alloc( vg_mem.rtmemory, inds_size );