Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YRUal-0001w1-8x for pgsql-committers@arkaria.postgresql.org; Fri, 27 Feb 2015 23:45:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YRUak-0000dI-08 for pgsql-committers@arkaria.postgresql.org; Fri, 27 Feb 2015 23:45:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YRUaj-0000d0-16 for pgsql-committers@postgresql.org; Fri, 27 Feb 2015 23:45:09 +0000 Received: from outmail148114.authsmtp.net ([62.13.148.114]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YRUaZ-0007WO-Ru for pgsql-committers@postgresql.org; Fri, 27 Feb 2015 23:45:07 +0000 Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235]) by punt16.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1RNivhf074098 for ; Fri, 27 Feb 2015 23:44:57 GMT Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1RNiuvS021104 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 27 Feb 2015 23:44:56 GMT Received: by mail-qg0-f42.google.com with SMTP id z107so16906158qgd.1 for ; Fri, 27 Feb 2015 15:44:56 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.32.5 with SMTP id g5mr32477686qgg.83.1425080696044; Fri, 27 Feb 2015 15:44:56 -0800 (PST) Received: by 10.140.242.199 with HTTP; Fri, 27 Feb 2015 15:44:55 -0800 (PST) In-Reply-To: References: Date: Fri, 27 Feb 2015 23:44:55 +0000 Message-ID: Subject: Re: pgsql: Invent a memory context reset/delete callback mechanism. From: Simon Riggs To: Tom Lane Cc: pgsql-committers Content-Type: text/plain; charset=UTF-8 X-Server-Quench: a2c7ff78-beda-11e4-b396-002590a15da7 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MOFUSTAAU OUFfK1tPLFAGXnlB XCVPDBYBExwtRzw3 PERTahorNxhRXQVr VVhLQVhWEA9tBlID BhcAWhxsdgxEZnpy ekNqWW9aEgB7Fzgk Bwg3FW8HZGdkJmMb WEgWJgEHd1UceRdY OAUrBW4MYDADeyhj TlF2Z2hrYGQHIX0I TghSO2gfEw44NRkZ YjE+IRgVJnhNXyoo Nhh0Yn8aAksXLg07 eV4sXFUCIlcZDQtC ElFRSDVUPFQdACYm CQ5GUAYVGTlZSy5X AVUtLxRICzpTQS8e bAAA X-Authentic-SMTP: 61633235383639.1023:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 209.85.192.42/587 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 27 February 2015 at 22:17, Tom Lane wrote: > Invent a memory context reset/delete callback mechanism. > > This allows cleanup actions to be registered to be called just before a > particular memory context's contents are flushed (either by deletion or > MemoryContextReset). The patch in itself has no use-cases for this, but > several likely reasons for wanting this exist. > > In passing, per discussion, rearrange some boolean fields in struct > MemoryContextData so as to avoid wasted padding space. For safety, > this requires making allowInCritSection's existence unconditional; > but I think that's a better approach than what was there anyway. Please can you document this in src/backend/utils/mmgr/README or other place? -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, RemoteDBA, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers