Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-19 Thread Janne Blomqvist
On Tue, Apr 19, 2011 at 20:53, Jakub Jelinek wrote: > On Tue, Apr 19, 2011 at 08:46:17PM +0300, Janne Blomqvist wrote: >> Oh, those macros are nice. I updated the patch to use them instead, >> except for one case where the usage didn't fit the XCNEW(VEC) API and >> I used xcalloc directly instead.

Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2011 at 08:46:17PM +0300, Janne Blomqvist wrote: > Oh, those macros are nice. I updated the patch to use them instead, > except for one case where the usage didn't fit the XCNEW(VEC) API and > I used xcalloc directly instead. Here's what I committed: For that remaining case there

Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-19 Thread Janne Blomqvist
On Tue, Apr 19, 2011 at 10:46, Jakub Jelinek wrote: > On Tue, Apr 19, 2011 at 10:41:33AM +0300, Janne Blomqvist wrote: >> On Mon, Apr 18, 2011 at 23:50, Steve Kargl >> wrote: >> > On Mon, Apr 18, 2011 at 11:41:33PM +0300, Janne Blomqvist wrote: >> >> Hi, >> >> >> >> the attached patch replaces gf

Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-19 Thread Jakub Jelinek
On Tue, Apr 19, 2011 at 10:41:33AM +0300, Janne Blomqvist wrote: > On Mon, Apr 18, 2011 at 23:50, Steve Kargl > wrote: > > On Mon, Apr 18, 2011 at 11:41:33PM +0300, Janne Blomqvist wrote: > >> Hi, > >> > >> the attached patch replaces gfc_getmem with calls to xcalloc (from > >> libiberty). Apart f

Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-19 Thread Janne Blomqvist
On Mon, Apr 18, 2011 at 23:50, Steve Kargl wrote: > On Mon, Apr 18, 2011 at 11:41:33PM +0300, Janne Blomqvist wrote: >> Hi, >> >> the attached patch replaces gfc_getmem with calls to xcalloc (from >> libiberty). Apart from reducing duplicated code, calloc is better than >> malloc + memset, as the

Re: [Patch, fortran] Use xcalloc instead of gfc_getmem

2011-04-18 Thread Steve Kargl
On Mon, Apr 18, 2011 at 11:41:33PM +0300, Janne Blomqvist wrote: > Hi, > > the attached patch replaces gfc_getmem with calls to xcalloc (from > libiberty). Apart from reducing duplicated code, calloc is better than > malloc + memset, as the allocator knows that the kernel always gives > out zeroed