Message ID | 80ee02cc-0571-0417-1729-cd7403cad703@netcologne.de |
---|---|
State | New |
Headers | show |
Series | [coarray_native,committed] Increase initial size on Darwin | expand |
diff --git a/libgfortran/caf_shared/shared_memory.c b/libgfortran/caf_shared/shared_memory.c index b64e40a3ded..0c0b36c663d 100644 --- a/libgfortran/caf_shared/shared_memory.c +++ b/libgfortran/caf_shared/shared_memory.c @@ -190,7 +190,16 @@ shared_memory_init (shared_memory_act **pmem) { shared_memory_act *mem; int fd; + + /* Darwin does not appear to be able to grow shared memory segments. Choose + 256 GB; that will likely be enough. If not, the ftruncate will fail + noisily. */ + +#ifdef __APPLE__ + size_t initial_size = ((size_t) 1) << 38; +#else size_t initial_size = round_to_pagesize (sizeof (global_shared_memory_meta)); +#endif mem = malloc (get_shared_memory_act_size (1)); fd = get_shmem_fd ();