On Mon, Sep 3, 2018 at 1:39 AM Bernhard Reutner-Fischer < rep.dot....@gmail.com> wrote:
> On Sun, 15 Jul 2018 at 13:20, Thomas Koenig <tkoe...@netcologne.de> wrote: > > + au = (async_unit *) xmalloc (sizeof (async_unit)); > > I'd XCNEW (async_unit) and omit all those NULL and 0 stores. > You should use the scalar allocators provided in include/libiberty.h > throughout, so s/xmalloc/XNEW/ and s/free/XDELETE/ and so on. > libgfortran uses it's own allocator wrappers in libgfortran/runtime/memory.c. Perhaps there is a case for switching to use these macros instead (why???), but if so, IMHO that should be done as a separate patch, also fixing all the other uses of the allocator wrappers. > +/* Enqueue a transfer statement. */ > + > +void > +enqueue_transfer (async_unit *au, transfer_args *arg, enum aio_do type) > +{ > + transfer_queue *tq = calloc (sizeof (transfer_queue), 1); > + tq->arg = *arg; > > boom on OOM. XCNEW (transfer_queue), please. > xcalloc, rather. -- Janne Blomqvist