| 1 | #include "platform.h" |
| 2 | |
| 3 | #include "platform/diskBack.unix.c" |
| 4 | #include "platform/displayMem.proc.c" |
| 5 | #include "platform/mmap-protect.c" |
| 6 | #include "platform/nonwin.c" |
| 7 | #include "platform/sysctl.c" |
| 8 | #include "platform/mmap.c" |
| 9 | |
| 10 | void GC_release (void *base, size_t length) { |
| 11 | munmap_safe (base, length); |
| 12 | } |
| 13 | |
| 14 | void *GC_mmapAnon (void *start, size_t length) { |
| 15 | return mmapAnonFlags (start, length, MAP_STACK); |
| 16 | } |
| 17 | |
| 18 | void *GC_mmapAnonFlags (void *start, size_t length, int flags) { |
| 19 | return mmapAnonFlags (start, length, flags | MAP_STACK); |
| 20 | } |
| 21 | |
| 22 | void *GC_mmapAnonStack (void *start, size_t length, int prot, |
| 23 | size_t dead_low, size_t dead_high) { |
| 24 | int flags = 0; |
| 25 | #ifdef MAP_STACK |
| 26 | flags |= MAP_STACK; |
| 27 | #endif |
| 28 | return GC_mmapAnonFlags_safe_protect (start, length, prot, flags, |
| 29 | dead_low, dead_high); |
| 30 | } |