pgsql: Add pairingheap_initialize() for shared memory usage
pgsql: Add pairingheap_initialize() for shared memory usage
От:
Alexander Korotkov <akorotkov@postgresql.org>
Дата:
Add pairingheap_initialize() for shared memory usage The existing pairingheap_allocate() uses palloc(), which allocates from process-local memory. For shared memory use cases, the pairingheap structure must be allocated via ShmemAlloc() or embedded in a shared memory struct. Add pairingheap_initialize() to initialize an already- allocated pairingheap structure in-place, enabling shared memory usage. Discussion: https://www.postgresql.org/message-id/flat/CAPpHfdsjtZLVzxjGT8rJHCYbM0D5dwkO+BBjcirozJ6nYbOW8Q@mail.gmail.com Discussion: https://www.postgresql.org/message-id/flat/CABPTF7UNft368x-RgOXkfj475OwEbp%2BVVO-wEXz7StgjD_%3D6sw%40mail.gmail.com Author: Kartyshov Ivan Author: Alexander Korotkov Reviewed-by: Michael Paquier Reviewed-by: Peter Eisentraut Reviewed-by: Dilip Kumar Reviewed-by: Amit Kapila Reviewed-by: Alexander Lakhin Reviewed-by: Bharath Rupireddy Reviewed-by: Euler Taveira Reviewed-by: Heikki Linnakangas Reviewed-by: Kyotaro Horiguchi Reviewed-by: Xuneng Zhou Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8af3ae0d4b36f4cbd6c72b12357ba928d02b3ebd Modified Files -------------- src/backend/lib/pairingheap.c | 18 ++++++++++++++++-- src/include/lib/pairingheap.h | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-)