qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 3/5] HACKING: add memory management rules
Date: Sun, 15 Aug 2010 17:50:37 +0000	[thread overview]
Message-ID: <AANLkTinfsuU7uU-t_=ChCBUk4PyMoqi+fgJ2snLcrQg9@mail.gmail.com> (raw)

Add memory management rules, somewhat like libvirt HACKING.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 HACKING |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/HACKING b/HACKING
index 7c6b49e..e0342df 100644
--- a/HACKING
+++ b/HACKING
@@ -68,3 +68,14 @@ it points to, or it is aliased to another pointer that is.

 2.3. Typedefs
 Typedefs are used to eliminate the redundant 'struct' keyword.
+
+3. Low level memory management
+
+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 replacement qemu_malloc/qemu_mallocz/qemu_realloc/qemu_free or
+qemu_vmalloc/qemu_memalign/qemu_vfree APIs.
+
+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.
-- 
1.6.2.4

             reply	other threads:[~2010-08-15 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 17:50 Blue Swirl [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-08-26 18:38 [Qemu-devel] [PATCH 3/5] HACKING: add memory management rules Blue Swirl
2010-08-27  8:45 ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTinfsuU7uU-t_=ChCBUk4PyMoqi+fgJ2snLcrQg9@mail.gmail.com' \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).