qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: marc.mari.barcelo@gmail.com, pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] libqos: add a simple first-fit memory allocator
Date: Wed, 30 Jul 2014 16:24:50 +0100	[thread overview]
Message-ID: <20140730152450.GJ597@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1406670884-29450-4-git-send-email-jsnow@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

On Tue, Jul 29, 2014 at 05:54:43PM -0400, John Snow wrote:
> diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
> index 2efd095..410181d 100644
> --- a/tests/libqos/malloc-pc.c
> +++ b/tests/libqos/malloc-pc.c
> @@ -21,41 +21,336 @@
>  
>  #define PAGE_SIZE (4096)
>  
> +typedef struct mem_block {

QEMU generally uses CamelCase for struct tags too.  The name can be the
same as the typedef (MemBlock).

> +    struct mem_block *prev;
> +    struct mem_block *next;

Please see include/qemu/queue.h for variants of linked lists.  QTAILQ
should work, then you can drop your custom doubly-linked list code.

> +            fprintf(stderr, "guest malloc leak @ 0x%016lx size 0x%016lx\n",
> +                    node->addr, node->size);

On 32-bit hosts %lx is 32-bit but addr is uint64_t.  Please use the
PRIx64 macro here and for other instances in this patch.

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-07-30 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 21:54 [Qemu-devel] [PATCH 0/4] libqos: add a simple first-fit memory allocator John Snow
2014-07-29 21:54 ` [Qemu-devel] [PATCH 1/4] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc John Snow
2014-07-29 21:54 ` [Qemu-devel] [PATCH 2/4] libqos: Change free function called in malloc John Snow
2014-07-29 21:54 ` [Qemu-devel] [PATCH 3/4] libqos: add a simple first-fit memory allocator John Snow
2014-07-30 15:24   ` Stefan Hajnoczi [this message]
2014-07-29 21:54 ` [Qemu-devel] [PATCH 4/4] qtest/ide-test: add pc-alloc-uninit call John Snow
  -- strict thread matches above, loose matches on Subject: below --
2014-07-30 22:28 [Qemu-devel] [PATCH v2 0/4] libqos: add a simple first-fit memory allocator John Snow
2014-07-30 22:28 ` [Qemu-devel] [PATCH 3/4] " John Snow
2014-07-31 10:13   ` Stefan Hajnoczi
2014-07-31 21:14     ` John Snow
2014-08-01 15:08       ` Stefan Hajnoczi
2014-08-04  8:22         ` Markus Armbruster

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=20140730152450.GJ597@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=marc.mari.barcelo@gmail.com \
    --cc=pbonzini@redhat.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).