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 1u6t9W-0078IJ-9p for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2025 15:33:46 +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 1u6t9T-006OKo-9y for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2025 15:33:44 +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 1u6t9S-006OKQ-V2 for pgsql-hackers@lists.postgresql.org; Mon, 21 Apr 2025 15:33:43 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u6t9Q-001CTk-26 for pgsql-hackers@lists.postgresql.org; Mon, 21 Apr 2025 15:33:41 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6e8f05acc13so54728016d6.2 for ; Mon, 21 Apr 2025 08:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1745249620; x=1745854420; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NMwpaEzYG8NwfwtwLzMBnuvzMYs4UycHNg4Czab1XgM=; b=e04XuAh/eYv4JQxnNwwqjFzFDyAj2Ie9s500TO97M0zP5vuGz4rP5mU/bacS+JGyTx xavsH/ObOddXacYly6N6lmbvbT2Reb/D7SAhCUXHeQsCCDetigCHy/geIzeAdVpfnHWT YmuhSfZsG3HvlwagU2nZqkXgsb5KLyYV0kIweBN4Y8h8BWDjZ+u/CBU5gRCmBPH7k18x o1L4c1MkoTB7+rSui01DHeJP32Z5SjGvob/OY9VyJ+r+wB9HyUV2gXrSP1xInCJZvEH1 N0/nj1pIwy/bg5hZLx9SHbV5u0jQfXoZRJ+Jc6xTXk4vge9dG/ld0qEjpICXnY7xDyxt KcXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745249620; x=1745854420; h=content-transfer-encoding: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=NMwpaEzYG8NwfwtwLzMBnuvzMYs4UycHNg4Czab1XgM=; b=PtNo6hANJVK/ms1cBtqL8iHozFDYLD7oJ1Fwa+7EVoWJgfSAY9eqJLtMltH8O3f/DS WQKhEvWdGp1UG2ITxhSHj3hcGrZpHEE5JcYLL6z3D1+rd0UncsDvFnjJP+hoIlLYfKgW 0Ji7Zj0ixQhUkzVn9YQ7qD0yI3aKjwa6inHxZgVpo8gEnxP+BitpCcXFdP0/1TUhC2c3 MZJ04iTh4+WZZMs8tdUWJeDDFY38GxW4egNz0Qm+eViwm71f5NhVz6KpFvmt2758VgDV 9u8igsoR+65HrYVhS7wUJpO9HquGyagp7gol8K9uzdNQILnlxqPWOVUVs2b+nRVtQPDG HYyQ== X-Forwarded-Encrypted: i=1; AJvYcCWfdya+I5Ne29iN2bxAnIaBN68j4BpPLMivUHmc7BEnGyhvQsU1KRSXo5VcJOOB9hoZt+hcipZoThzbkaIu@lists.postgresql.org X-Gm-Message-State: AOJu0YyHYyGzpQJksi8ti01duY3ySpXwB9gtqUN0LUmfDx0S32SkGaSr RagpRWlEl0JYn0m2/iIXrcwlb8vQGgdeYBYCfPDBCKTtBSMDHZH7BYl1pVuo7U/tA7JvGAPoblM acN/mX9dWP8fTIQP3dRFHLjXpTYw1X8ZmT7b6 X-Gm-Gg: ASbGncujDdijtXg5cfHAW4wq9kqR1Vsh/I4r4Tpkw0mbj3X/G1kgw68WC2wzJetTybX 9Nw8bq1C7U3wzFQDu4ljZRNurcYspGTUB/pPWYGopfMXOVYGkOWKD7oT/3f/XM/w+8tbYBHzGsU iWrdYrzbR3KKv8VRIyeDqs X-Google-Smtp-Source: AGHT+IGOzv6teQ1MGBEXYUgaD3yxUsW52HNKkgxcb6WrvhDYO6dVB6ZFrTfeyEH0JwaERqmfxqOzrcMx/OSx0N23QLE= X-Received: by 2002:ad4:5d6b:0:b0:6e8:ec85:831c with SMTP id 6a1803df08f44-6f2c4650cd9mr245503626d6.35.1745249620057; Mon, 21 Apr 2025 08:33:40 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <25801148-284F-41F9-A279-A4CF92623C77@yesql.se> From: Jacob Champion Date: Mon, 21 Apr 2025 08:33:28 -0700 X-Gm-Features: ATxdqUGzhWGO8V_YrGVN_xs7dzlu6EwzqIcSRJeF-mnIvNdOhSholUcZ3-slNws Message-ID: Subject: Re: jsonapi: scary new warnings with LTO enabled To: Daniel Gustafsson Cc: Tom Lane , PostgreSQL Developers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 outsi= de of > the JSON api it might be better to keep the calloc and explicitly free it= ? 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. > (Could a JsonLexContextBroken() function be useful perhaps?) Maybe if there's ever a client that absolutely must initialize a context before doing a bunch of independent work? But I don't think that's true here. (Any callers we're converting from the stack API are going to have short-lived contexts.) --Jacob