Re: [libvirt] [PATCH]: Fix VIR_ALLOC_N for 0 byte arrays

2008-06-19 Thread Daniel P. Berrange
On Thu, Jun 19, 2008 at 05:51:07AM -0400, Daniel Veillard wrote: > On Thu, Jun 19, 2008 at 10:49:59AM +0200, Chris Lalancette wrote: > > Hello, > > For 0.4.3, danpb's new memory management scheme went into libvirt. > > This is > > fine, except that is subtly alters the semantics of malloc(),

Re: [libvirt] [PATCH]: Fix VIR_ALLOC_N for 0 byte arrays

2008-06-19 Thread Daniel Veillard
On Thu, Jun 19, 2008 at 10:49:59AM +0200, Chris Lalancette wrote: > Hello, > For 0.4.3, danpb's new memory management scheme went into libvirt. This > is > fine, except that is subtly alters the semantics of malloc(), calloc(), and > realloc(). In particular, if you say: > > foo = malloc(0

Re: [libvirt] [PATCH]: Fix VIR_ALLOC_N for 0 byte arrays

2008-06-19 Thread Jim Meyering
Chris Lalancette <[EMAIL PROTECTED]> wrote: > For 0.4.3, danpb's new memory management scheme went into libvirt. This > is > fine, except that is subtly alters the semantics of malloc(), calloc(), and > realloc(). In particular, if you say: > > foo = malloc(0); > > glibc will happily return

[libvirt] [PATCH]: Fix VIR_ALLOC_N for 0 byte arrays

2008-06-19 Thread Chris Lalancette
Hello, For 0.4.3, danpb's new memory management scheme went into libvirt. This is fine, except that is subtly alters the semantics of malloc(), calloc(), and realloc(). In particular, if you say: foo = malloc(0); glibc will happily return a non-NULL pointer to you. However, with the new m