On Mon, Nov 14, 2016 at 10:17 AM, Andres Freund <and...@anarazel.de> wrote: > I think so, yes. IIRC I discussed it with Noah and Peter G. at a > conference recently. We'd basically mark the content of shared buffers > inaccessible at backend startup, and mark it accessible whenever a > PinBuffer() happens, and then inaccessible during unpinning. We probably > have to exclude the page header though, as we intentionally access them > unpinned in some cases IIRC.
BTW, I recently noticed that the latest version of Valgrind, 3.12, added this new feature: * Memcheck: - Added meta mempool support for describing a custom allocator which: - Auto-frees all chunks assuming that destroying a pool destroys all objects in the pool - Uses itself to allocate other memory blocks It occurred to me that we might be able to make good use of this. To be clear, I don't think that there is reason to tie it to adding the PinBuffer() stuff, which we've been talking about for years now. It just caught my eye. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers