|
|
@ -40,4 +40,8 @@ void* create_shared_memory(size_t size) {
|
|
|
|
// The remaining parameters to `mmap()` are not important for this use case,
|
|
|
|
// The remaining parameters to `mmap()` are not important for this use case,
|
|
|
|
// but the manpage for `mmap` explains their purpose.
|
|
|
|
// but the manpage for `mmap` explains their purpose.
|
|
|
|
return mmap(NULL, size, protection, visibility, -1, 0);
|
|
|
|
return mmap(NULL, size, protection, visibility, -1, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void free_shared_memory(void* ptr, size_t size) {
|
|
|
|
|
|
|
|
munmap(ptr, size);
|
|
|
|
}
|
|
|
|
}
|