From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by sourceware.org (Postfix) with ESMTPS id B454F3858D1E for ; Wed, 17 May 2023 18:53:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B454F3858D1E Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=rodriguez.im Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cristianrodriguez.net Received: by mail-ua1-x932.google.com with SMTP id a1e0cc1a2514c-783b8b4c7e3so67439241.0 for ; Wed, 17 May 2023 11:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rodriguez.im; s=google; t=1684349620; x=1686941620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GdMCaap8274DrcmthTUliVhmIhH3Wx3VzV/hT6t+f3A=; b=ANi5Sc+CqiIMBnvjEcCNxbQEz0b5cawleeueL4RiAWJrW9JlNe7UOMVY2tZxQWt3TF WW2zFMCa2TVDxz6pB//je8rN+DpHSHE8xhx9Hv3OgCsD/9UYwY3ahxrPJRvbCy9I+7+S rGMubg+KbuARyXfC97FJIPsfsJFBYghregcGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684349620; x=1686941620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GdMCaap8274DrcmthTUliVhmIhH3Wx3VzV/hT6t+f3A=; b=Fcl4cnqJBtSJwMAz2iIHWdSiBfMyIyh5LVAKrg4XIpk/74FMa5AhJOf9XeF/HiFxGo PKlXbzQiK1fZeGQ26TzDGgi94nlLBbCUIcjTrCROpldg+Z5aSEy+tMs4VKZhzbEQmdMU 9MBpSD/W6+hDJCnJl0R3uvtcgx0U/03YC2LnPJBosQqPbyWp9xRkShJINfmtvil23szg gkF/jkFXBCau5+0i1kFRszdrGBt5sUke3fc9Uw2rLi63QJefNWgvHtpgVg0niiGJFbHa /mK1NUwRl+7W1J+xOiF7a4hmsRNnzCx5q1d/u83rtqg5stt4jwTAtNYJIzeakjOz1/oj jITg== X-Gm-Message-State: AC+VfDxMENEoNj+YsKDnDSFQ+4Yj+9PQ4pdODjmiOOv/zO30zZQDbd/I aQVxaz0HQfkMcE3GFc7VvrXV54G9+ucvxkT7wY2G+aULs/aLQQbp04E= X-Google-Smtp-Source: ACHHUZ4ECGhqLUUgdDW6ZE7AVYWztC9OwGt9MtWmCXPgxjrjLidAKMoesXnE6tRRKMAy7b4lDqZLzAHSJD8HXgrf9TY= X-Received: by 2002:a05:6102:150d:b0:42c:599d:f96a with SMTP id f13-20020a056102150d00b0042c599df96amr1805390vsv.0.1684349619976; Wed, 17 May 2023 11:53:39 -0700 (PDT) MIME-Version: 1.0 References: <20230515185012.2768620-1-josimmon@redhat.com> <8e9beea2-b128-83f1-dead-2c3866e28182@cs.ucla.edu> In-Reply-To: <8e9beea2-b128-83f1-dead-2c3866e28182@cs.ucla.edu> From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Wed, 17 May 2023 14:53:24 -0400 Message-ID: Subject: Re: [PATCH v3] vfprintf-internal: Replace alloca with malloc. To: Paul Eggert Cc: Joe Simmons-Talbott , libc-alpha@sourceware.org Content-Type: multipart/alternative; boundary="000000000000c6cf5405fbe834fc" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000c6cf5405fbe834fc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2023 at 2:10=E2=80=AFPM Paul Eggert wr= ote: > On 2023-05-15 11:50, Joe Simmons-Talbott via Libc-alpha wrote: > > + args_value[cnt].pa_user =3D malloc (args_size[cnt]); > > + if (args_value[cnt].pa_user =3D=3D NULL) > > + break; > > Shouldn't an error be returned if a printf function runs out of memory > internally? > Yes. > > Also, that function already uses a scratch buffer; why not grow the > scratch buffer instead of calling malloc separately? > I was going to make the suggestion.. scratch_buffer all things possible since afair it was built specifically to replace most if not all the __use_alloca thingies. --000000000000c6cf5405fbe834fc--