qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/5] CODING_STYLE: add memory management rules


From: Blue Swirl
Subject: [Qemu-devel] [PATCH 3/5] CODING_STYLE: add memory management rules
Date: Thu, 12 Aug 2010 17:50:17 +0000

Add memory management rules, somewhat like libvirt HACKING.

Signed-off-by: Blue Swirl <address@hidden>
---
 CODING_STYLE |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/CODING_STYLE b/CODING_STYLE
index 3f10d72..085c86f 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -148,3 +148,11 @@ up-front that this is a read-only pointer.  Perhaps more
 importantly, if we're diligent about this, when you see a non-const
 pointer, you're guaranteed that it is used to modify the storage
 it points to, or it is aliased to another pointer that is.
+
+
+7. Low level memory management
+
+Use of the malloc/free/realloc/calloc APIs is not allowed in the QEMU
+codebase. Instead of these routines, use the replacement
+qemu_malloc/qemu_mallocz/qemu_realloc/qemu_free or
+qemu_vmalloc/qemu_memalign/qemu_vfree APIs.
-- 
1.6.2.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]