Nicholas White escribió:
> > But even if we did decide to switch memory contexts on every call, it would still be much cleaner than this.
>
> I've removed all the bms_initalize code from the patch and am using
> this solution. As the partition memory is zero-initialised I just
> store a Bitmapset pointer in the WinGetPartitionLocalMemory. The
> bms_add_member and bms_is_member functions behave sensibly for
> null-pointer inputs (they return a bms_make_singleton in the current
> memory context and false respectively). I've surrounded the calls to
> bms_make_singleton with a memory context switch (to the partition's
> context) so the Bitmapset stays in the partition's context.
Now that I look again, would GetMemoryChunkContext() be useful here?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services