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 1qoKQm-000tS5-Jk for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 09:14:05 +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 1qoKQk-00AvB8-Iq for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Oct 2023 09:14:03 +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 1qoKQj-00Av9X-Io for pgsql-hackers@lists.postgresql.org; Thu, 05 Oct 2023 09:14:03 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qoKQg-0007gS-GM for pgsql-hackers@lists.postgresql.org; Thu, 05 Oct 2023 09:14:01 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5D46B5C049A; Thu, 5 Oct 2023 05:13:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 05 Oct 2023 05:13:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1696497237; x= 1696583637; bh=GlfOOe4H4hjyTJYc4HlMvPecNGQO5cuqNqh5vlDuUO8=; b=E 9UDYjRkJv55/TeDyBAU1PUOVzyDmtKrSWS7PSWONXzwZQj9wNnnAxhyrfookQnbL suuLaiWyS9BWuAr23AnukqnYTk3uoxyHee7C7XpsgyPJb2zWiujnsxwq5txJ6DlS RKKuGYer74vQi29NIwFObIfSVkCapLCapGqLyI8aEPevF/qTa6k0z9sg3AzIW7Av kW19MUAU2z5erMuSikya+bCOFARRuOgQ8/gDtSJFaNtH6Mu0xUpi4EDfPBREQeCN 8WgJaXGsLwTCYGvF3QsCszCFqkUsoJEE371Xvy/uWcQLidUqTZ5An3Zg896cnLre YfFYAZ9JsiaxXk3UsAcZw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrgeeggdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Oct 2023 05:13:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1696497234; bh=s4C62OTiuN0DUDT0CcJcvpBQ4XRSqL5LUxiCRHL4cZ0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=FpbEHtXOKVkcHLclPHXDF7raDDo+f0ax5+qVkrnAcp9JQnnVkreAmS6atxCxIC940 loIQX1xFNU3ZRLzsyyEMu6cXHrO1q11wUlw3eM530DOmhj6/P491kDRpug69rk0IRo od8bFK9ox1AFeb4VRlZde3Cky9emzyOj2Y8aCca/3ipPvCbrXZvWJsVNSg4+gaCqRA vr8m6f4TGHPEsfJZHK6cmICb8qm3/L9zBgPGZq3SkUjRLBK2yn8oKb6Hi90+zgQtpb IiXBnOGKMyO0HNZab2z2DN5UFohwyG7l3lyzuhkIJRQ42lZ46U1tcQc6iOHHAfrUH2 Lg0u6FpoWyH/w== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 3B766128; Thu, 5 Oct 2023 11:13:54 +0200 (CEST) Date: Thu, 5 Oct 2023 11:13:54 +0200 From: Alvaro Herrera To: Amit Langote Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Some refactoring to export json(b) conversion functions Message-ID: <202310050913.s6zyrpyuy7yq@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230808174110.oq3iymllsv6amkih@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Aug-08, Alvaro Herrera wrote: > One idea that Tom floated was to allow the JsonLexContext to be > optionally stack-allocated. That reduces palloc() traffic; but some > callers do need it to be palloc'ed. Here's a patch that does it that > way, and adds a freeing routine that knows what to do in either case. > It may make sense to do some further analysis and remove useless free > calls. Pushed this, after some further tweaking. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "La verdad no siempre es bonita, pero el hambre de ella sí"