Summary:
This diff adds `ReservedAddressSpace`, which is a manager for a reserved virtual address space,
and `AddressSpaceNegotiator`, which finds a segment of virtual memory that is unused in both
parent and child process for use with `ReservedAddressSpace`.
Since we call `exec()` (or `posix_spawn()`) when starting up postmaster, all memory mappings
created by tserver beforehand are lost. In order to have a reserved virtual address space
at the same address for both tserver and postmaster, `AddressSpaceNegotiator` has the
parent process propose addresses to start the reserved address space at that work for the parent,
and has the child accept or reject it depending on whether or not it works for the child. The
block of virtual addresses is reserved with
`mmap(..., PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE)` .
The negotiated address space is then passed to `ReservedAddressSpace`, which provides methods to
lay out `mmap` calls on fixed addresses in the space with `MAP_FIXED`. Since the reserved segment
is at the same address in both child and parent, this provides us with a building block for having
pointers that are meaningful in both processes.
This is needed for future changes to move the table locks lock manager into shared memory. For more
context: D40272.
Jira: DB-14793
Test Plan: Added unit tests: `./yb_build.sh --cxx-test 'util_reserved_address_space-test'`
Reviewers: sergei, bkolagani
Reviewed By: sergei
Subscribers: ybase, rthallam, zdrudi, amitanand
Differential Revision: https://phorge.dev.yugabyte.com/D41083