summaryrefslogtreecommitdiffstats
path: root/util/memalign.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/memalign.c')
-rw-r--r--util/memalign.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/memalign.c b/util/memalign.c
index 083aaae619..440b8fd9a7 100644
--- a/util/memalign.c
+++ b/util/memalign.c
@@ -78,3 +78,14 @@ void *qemu_memalign(size_t alignment, size_t size)
size, alignment, strerror(errno));
abort();
}
+
+void qemu_vfree(void *ptr)
+{
+ trace_qemu_vfree(ptr);
+#if !defined(CONFIG_POSIX_MEMALIGN) && defined(CONFIG_ALIGNED_MALLOC)
+ /* Only Windows _aligned_malloc needs a special free function */
+ _aligned_free(ptr);
+#else
+ free(ptr);
+#endif
+}