diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-13 16:19:55 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-05-14 08:53:31 -0500 |
commit | 6eebf958abf3f3f701116d4524ef88bb9fd6e341 (patch) | |
tree | 3dc67c3bb03950bef367f956c4c28d798dc6c309 /HACKING | |
parent | d34dc45d34618aa2495e892caba62a4aa521b386 (diff) |
osdep, kvm: rename low-level RAM allocation functions
This is preparatory to the introduction of a separate freeing API.
Reported-by: Amos Kong <akong@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Message-id: 1368454796-14989-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'HACKING')
-rw-r--r-- | HACKING | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -78,16 +78,15 @@ avoided. Use of the malloc/free/realloc/calloc/valloc/memalign/posix_memalign APIs is not allowed in the QEMU codebase. Instead of these routines, use the GLib memory allocation routines g_malloc/g_malloc0/g_new/ -g_new0/g_realloc/g_free or QEMU's qemu_vmalloc/qemu_memalign/qemu_vfree +g_new0/g_realloc/g_free or QEMU's qemu_memalign/qemu_blockalign/qemu_vfree APIs. Please note that g_malloc will exit on allocation failure, so there is no need to test for failure (as you would have to with malloc). Calling g_malloc with a zero size is valid and will return NULL. -Memory allocated by qemu_vmalloc or qemu_memalign must be freed with -qemu_vfree, since breaking this will cause problems on Win32 and user -emulators. +Memory allocated by qemu_memalign or qemu_blockalign must be freed with +qemu_vfree, since breaking this will cause problems on Win32. 4. String manipulation |