void*
mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
{
- return g_malloc (length);
+ g_assert (addr == NULL);
+ return mono_valloc_aligned (length, mono_pagesize (), flags, type);
}
void*
mono_valloc_aligned (size_t size, size_t alignment, int flags, MonoMemAccountType type)
{
- g_assert_not_reached ();
+ void *res = NULL;
+ if (posix_memalign (&res, alignment, size))
+ return NULL;
+ return res;
}
#define HAVE_VALLOC_ALIGNED