From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68507 invoked by alias); 3 Sep 2018 11:49:10 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 68433 invoked by uid 89); 3 Sep 2018 11:49:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:sk:CAC1Bbc, H*f:sk:g0KWn_P, H*i:sk:AwS29EH, H*f:CAO9iq9HSR6 X-HELO: mail-oi0-f54.google.com Received: from mail-oi0-f54.google.com (HELO mail-oi0-f54.google.com) (209.85.218.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Sep 2018 11:49:04 +0000 Received: by mail-oi0-f54.google.com with SMTP id l202-v6so482390oig.7; Mon, 03 Sep 2018 04:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7OVVeMlb/Uv7Acv6pjXIs8vLF1F+nJ4iUyXtE4cckp4=; b=dG8w/rO+Kl9/07GOFiupUN15k4j1aOLySA1Dtywh2MjuRXVPARyKboIEijhNYQtUDF 0qCXQyiZ5Eru9wqhJmkiU5Pzb6uDFbz/HW1khwo40kjp9ipDtWY3qwo8aSnezi4wRJR1 A4kFGfrdCgpqYoladUHtGZSI9Zh8OWMWnZZfkUlHRoxKstmbNJFVWvy+HSMw8ZDLBIxb pVvkauHiQZg3obHVhl5+tiAtVHHHhsi59pG7LkFBAzC+tnN1oEXw0X6EBPzlR/PI9k37 7eaGV0sLyF8GYVybXooqMY2H7+frxHXlVTNAHuMDvA4Xa/aV1wEB5roSEXdpfnRtNuFF wY4g== MIME-Version: 1.0 References: In-Reply-To: From: Bernhard Reutner-Fischer Date: Mon, 03 Sep 2018 11:49:00 -0000 Message-ID: Subject: Re: [patch, fortran] Asynchronous I/O, take 3 To: Janne Blomqvist Cc: Thomas Koenig , =?UTF-8?Q?Dominique_d=27Humi=C3=A8res?= , nk@koenigni.com, gfortran , GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00008.txt.bz2 On Mon, 3 Sep 2018 at 11:07, Janne Blomqvist wrote: > > On Mon, Sep 3, 2018 at 1:39 AM Bernhard Reutner-Fischer wrote: >> >> On Sun, 15 Jul 2018 at 13:20, Thomas Koenig 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,