Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u6vkj-007zpM-Dy for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2025 18:20:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u6vkg-007YKS-FB for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2025 18:20:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u6vkf-007YKI-LX for pgsql-hackers@lists.postgresql.org; Mon, 21 Apr 2025 18:20:18 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u6vkd-001Djx-0n for pgsql-hackers@lists.postgresql.org; Mon, 21 Apr 2025 18:20:17 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 8F7FB373AB4 for ; Mon, 21 Apr 2025 20:20:11 +0200 (CEST) Received: from s899.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 7AC59373E1A; Mon, 21 Apr 2025 20:20:11 +0200 (CEST) Received: from s470.loopia.se (unknown [172.22.191.6]) by s899.loopia.se (Postfix) with ESMTP id 77D3B2C8BA7C; Mon, 21 Apr 2025 20:20:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s470.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s899.loopia.se ([172.22.191.5]) by s470.loopia.se (s470.loopia.se [172.22.190.34]) (amavisd-new, port 10024) with LMTP id jd3x8zY7Mo8s; Mon, 21 Apr 2025 20:20:11 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s899.loopia.se (Postfix) with ESMTPSA id 134662C8BA29; Mon, 21 Apr 2025 20:20:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1745259611; bh=0IpxAs/ZZR67vkcUcG393oaSsvjAVDoXROt7K70GLYY=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=RGzvF8oVIt+anGOSYeVzWkNFaHyeY8j0UPajNxTzUuQE8SLALIUlWq2Fq11xcd39g n5v6d5qJhcunyfeBTV3tvkaPatXy6V89x2eEA23wMDtfxLPli3aIpNonyFrbj7OFjM 0/CoISS7FrwOceeXUwB8B26ByvTkcMZlhq3UeAPtNh5LWR1FqAVpi2LWZ0u6NbrIQJ hdRByXaB2Zr4228v5dt7GfXeTYrTb7/Ujt/hO5aPcqdWwZLIQip5wWnW37chSKPS6L mWlXjo5a3s7JViXck78JpnXEhvPldjInrc7xjd/QQlYs0t1hFnZFXUQUb8B98Og0Er jA/JVx2i0IJow== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: jsonapi: scary new warnings with LTO enabled From: Daniel Gustafsson In-Reply-To: Date: Mon, 21 Apr 2025 20:20:00 +0200 Cc: Tom Lane , PostgreSQL Developers Content-Transfer-Encoding: quoted-printable Message-Id: References: <2074634.1744839761@sss.pgh.pa.us> <0A3CF5C4-9947-42E3-89A9-34FCF7BA95BA@yesql.se> <2078511.1744841564@sss.pgh.pa.us> <2084687.1744844690@sss.pgh.pa.us> <2087556.1744846124@sss.pgh.pa.us> <0A596D8B-24F3-408F-B89B-B42014B00A05@yesql.se> <2202326.1744903233@sss.pgh.pa.us> <25801148-284F-41F9-A279-A4CF92623C77@yesql.se> To: Jacob Champion X-Mailer: Apple Mail (2.3776.700.51.11.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 21 Apr 2025, at 17:33, Jacob Champion = wrote: >=20 > On Sat, Apr 19, 2025 at 2:15=E2=80=AFPM Daniel Gustafsson = wrote: >> Since there is no way to determine if the allocation succeeded from = outside of >> the JSON api it might be better to keep the calloc and explicitly = free it? >=20 > I don't think so; pg_parse_json() will error out quickly, so I don't > see much advantage to the extra code. Raw performance isn't much of a > concern for the out-of-memory case, IMO. Sure, but I fear we'll get an endless stream of static analysis reports = for the allocation leaking if we don't free it. -- Daniel Gustafsson