mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-13 09:49:11 +03:00
include process id in expect buffer name
This commit is contained in:
parent
19ea3489cb
commit
2b60cb1dcd
@ -921,9 +921,9 @@ fn roc_dev_native(
|
||||
|
||||
let mut signals = Signals::new(&[SIGCHLD, SIGUSR1]).unwrap();
|
||||
|
||||
// let shm_name = format!("/roc_expect_buffer_{}", std::process::id());
|
||||
let shm_name = "/roc_expect_buffer";
|
||||
let memory = ExpectMemory::create_or_reuse_mmap(shm_name);
|
||||
// let shm_name =
|
||||
let shm_name = format!("/roc_expect_buffer_{}", std::process::id());
|
||||
let memory = ExpectMemory::create_or_reuse_mmap(&shm_name);
|
||||
|
||||
let layout_interner = layout_interner.into_global();
|
||||
|
||||
|
@ -30,8 +30,13 @@ extern fn roc_getppid() c_int;
|
||||
|
||||
pub fn readSharedBufferEnv() callconv(.C) void {
|
||||
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
|
||||
const name = "/roc_expect_buffer"; // IMPORTANT: shared memory object names must begin with / and contain no other slashes!
|
||||
const shared_fd = roc_shm_open(@ptrCast(*const i8, name), O_RDWR | O_CREAT, 0o666);
|
||||
// const name = "/roc_expect_buffer";
|
||||
|
||||
// IMPORTANT: shared memory object names must begin with / and contain no other slashes!
|
||||
var name: [100]u8 = undefined;
|
||||
_ = std.fmt.bufPrint(name[0..100], "/roc_expect_buffer_{}\x00", .{roc_getppid()}) catch unreachable;
|
||||
|
||||
const shared_fd = roc_shm_open(@ptrCast(*const i8, &name), O_RDWR | O_CREAT, 0o666);
|
||||
const length = 4096;
|
||||
|
||||
const shared_ptr = roc_mmap(
|
||||
|
Loading…
Reference in New Issue
Block a user