Ticket #5230 (closed Feature Requests: fixed)
Interprocess shared memory between 32 and 64 bit processes
|Reported by:||tgermer@…||Owned by:||igaztanaga|
|Milestone:||To Be Determined||Component:||interprocess|
|Version:||Boost Development Trunk||Severity:||Problem|
|Keywords:||shared memory 32 64 bit||Cc:||aschoedl@…|
For sharing memory between 32 and 64 bit processes, all structures in shared memory must have the same binary layout with matching size_type and difference_type. In addition, offset_ptr must be 64bit in this case.
This is a patch that parameterizes offset_ptr to explicitly accept its difference_type along with its internal offset_type. This difference_type (and the according size_type) is propagated to all other affected structures (memory algorithms, allocators, containers, ...). In 32/64 bit shared environments, difference_type should be set to int and offset_type to unsigned __int64. The default values are ptrdiff_t and size_t.
Note: rbtree_best_fit also uses offset_type to store its internal block sizes, because these need to wrap-around correctly on 64bit machines.
comment:19 follow-up: ↓ 20 Changed 5 years ago by igaztanaga
- Status changed from new to closed
- Resolution set to fixed