mirror of
https://github.com/thinkonmay/sunshine-sdk.git
synced 2025-12-26 14:41:14 +00:00
allocate internal shared memory
This commit is contained in:
parent
801fb18c32
commit
dbd8a2ef91
@ -63,7 +63,7 @@ std::string gen_random(const int len) {
|
||||
}
|
||||
|
||||
std::string randkey = gen_random(20);
|
||||
managed_shared_memory segment(create_only, randkey.c_str(), 2 * sizeof(SharedMemory));
|
||||
managed_shared_memory segment(create_only, randkey.c_str(), 2 * sizeof(SharedMemoryInternal));
|
||||
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ EXPORTS(SharedMemory*)
|
||||
allocate_shared_memory(char* rand) {
|
||||
//Allocate a portion of the segment (raw memory)
|
||||
std::size_t free_memory = segment.get_free_memory();
|
||||
SharedMemory* memory = (SharedMemory*)segment.allocate(sizeof(SharedMemory));
|
||||
SharedMemory* memory = (SharedMemory*)segment.allocate(sizeof(SharedMemoryInternal));
|
||||
init_shared_memory(memory);
|
||||
|
||||
//Check invariant
|
||||
|
||||
Loading…
Reference in New Issue
Block a user