On Mon, 3 Sep 2018 at 11:07, Janne Blomqvist <blomqvist.ja...@gmail.com> wrote:
>
> 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.

The macros are shorter to type. Furthermore we use them in the
frontend already so maybe using them also in the runtime too would be
easier to remember.
As to eventually doing so in a separate patch, that's fair enough.

>
>>
>> +/* 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.

right.

thanks,

Reply via email to