@@ -46,6 +46,34 @@ mem_allocator_realloc(mem_allocator_t allocator, void *ptr, uint32_t size);
4646void
4747mem_allocator_free (mem_allocator_t allocator , void * ptr );
4848
49+ /* Aligned allocation support */
50+ #ifndef GC_MIN_ALIGNMENT
51+ #define GC_MIN_ALIGNMENT 8
52+ #endif
53+
54+ #if BH_ENABLE_GC_VERIFY == 0
55+
56+ void *
57+ mem_allocator_malloc_aligned (mem_allocator_t allocator , uint32_t size ,
58+ uint32_t alignment );
59+
60+ #define mem_allocator_malloc_aligned_internal (allocator , size , alignment , \
61+ file , line ) \
62+ mem_allocator_malloc_aligned(allocator, size, alignment)
63+
64+ #else /* BH_ENABLE_GC_VERIFY != 0 */
65+
66+ void *
67+ mem_allocator_malloc_aligned_internal (mem_allocator_t allocator ,
68+ uint32_t size , uint32_t alignment ,
69+ const char * file , int line );
70+
71+ #define mem_allocator_malloc_aligned (allocator , size , alignment ) \
72+ mem_allocator_malloc_aligned_internal(allocator, size, alignment, \
73+ __FILE__, __LINE__)
74+
75+ #endif /* end of BH_ENABLE_GC_VERIFY */
76+
4977int
5078mem_allocator_migrate (mem_allocator_t allocator , char * pool_buf_new ,
5179 uint32 pool_buf_size );
0 commit comments