All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Tommi Rantala <tt.rantala@gmail.com>
Cc: Dave Jones <davej@redhat.com>, trinity@vger.kernel.org
Subject: Re: [PATCH trinity v2, RFT] trinity: use Boehm-Demers-Weiser's garbage collecting memory allocator
Date: Mon, 03 Jun 2013 13:54:07 +0200	[thread overview]
Message-ID: <51AC83DF.5020203@redhat.com> (raw)
In-Reply-To: <CA+ydwtrZKC+8UQA0gw_Qp9PffUT5wrzr3e+qnQnfyFc78zEKKQ@mail.gmail.com>

On 06/03/2013 08:25 AM, Tommi Rantala wrote:
> 2013/5/26 Daniel Borkmann <dborkman@redhat.com>:
>> diff --git a/devices.c b/devices.c
>> index 0493c39..2e115f8 100644
>> --- a/devices.c
>> +++ b/devices.c
>> @@ -8,6 +8,7 @@
>>   #include <sys/types.h>
>>   #include <linux/kdev_t.h>
>>
>> +#include "trinity.h"
>>   #include "log.h"
>>
>>   static struct {
>> @@ -37,9 +38,9 @@ static void parse_proc_devices(void)
>>                          block = 1;
>>                  else if (sscanf(line, "%d %as", &major, &name) == 2) {
>>                          if (block) {
>> -                               new = realloc(block_devs, (bldevs+1)*sizeof(*block_devs));
>> +                               new = bdw_realloc(block_devs, (bldevs+1)*sizeof(*block_devs));
>>                                  if (!new) {
>> -                                       free(name);
>> +                                       bdw_free(name);
>>                                          continue;
>>                                  }
>>                                  block_devs = new;
>> @@ -48,9 +49,9 @@ static void parse_proc_devices(void)
>>                                  block_devs[bldevs].name = name;
>>                                  bldevs++;
>>                          } else {
>> -                               new = realloc(char_devs, (chrdevs+1)*sizeof(*char_devs));
>> +                               new = bdw_realloc(char_devs, (chrdevs+1)*sizeof(*char_devs));
>>                                  if (!new) {
>> -                                       free(name);
>> +                                       bdw_free(name);
>>                                          continue;
>>                                  }
>>                                  char_devs = new;
>> @@ -63,7 +64,7 @@ static void parse_proc_devices(void)
>>          }
>>
>>          fclose(fp);
>> -       free(line);
>> +       bdw_free(line);
>>   }
>
> 'line' is allocated implicitly by getline(), is it safe to bdw_free() it?

True, thanks for catching! Not sure if we want to proceed with this patch or put it
on hold for now? Let me know, if wished, I could send an update.

  reply	other threads:[~2013-06-03 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-26 10:36 [PATCH trinity v2, RFT] trinity: use Boehm-Demers-Weiser's garbage collecting memory allocator Daniel Borkmann
2013-06-03  6:25 ` Tommi Rantala
2013-06-03 11:54   ` Daniel Borkmann [this message]
2013-06-03 12:40     ` Tommi Rantala
2013-06-03 18:11       ` Daniel Borkmann

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=51AC83DF.5020203@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davej@redhat.com \
    --cc=trinity@vger.kernel.org \
    --cc=tt.rantala@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.