This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] Use xcalloc instead of gfc_getmem
On Tue, Apr 19, 2011 at 10:41:33AM +0300, Janne Blomqvist wrote:
> On Mon, Apr 18, 2011 at 23:50, Steve Kargl
> <sgk@troutmask.apl.washington.edu> 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 allocator knows that the kernel always gives
> >> out zeroed pages so in some cases it can avoid memset'in the area.
> >>
> >> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
> >>
> >
> > OK.
>
> Thanks; I'll commit it later today when I get home.
Please don't. You should be using macros from libiberty.h like rest
of gcc instead. So instead of xcalloc use XCNEW, XCNEWVEC or XCNEWVAR
and remove the casts.
Jakub