diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-02-07 10:09:10 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-08 10:42:04 -0500 |
commit | 3320ab409939b5450f130edc9f882bde2970e0ff (patch) | |
tree | 4b62c9d526c06c1790cda728994d0fbf1f56e054 | |
parent | f115c382a0b0cc9299e73bcb8a11ad97c5fe7c57 (diff) | |
download | haskell-3320ab409939b5450f130edc9f882bde2970e0ff.tar.gz |
rts/MemoryMap: Use mach_-prefixed type names
There appears to be some inconsistency in system-call type naming across
Darwin toolchains. Specifically:
* the `address` argument to `mach_vm_region` apparently wants to be a
`mach_vm_address_t *`, not a `vm_address_t *`
* the `vmsize` argument to `mach_vm_region` wants to be a
`mach_vm_size_t`, not a `vm_size_t`
-rw-r--r-- | rts/MemoryMap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rts/MemoryMap.c b/rts/MemoryMap.c index 67db8b4830..93c9bc53df 100644 --- a/rts/MemoryMap.c +++ b/rts/MemoryMap.c @@ -78,8 +78,8 @@ void reportMemoryMap() { // Inspired by MacFUSE /proc implementation debugBelch("\nMemory map:\n"); while (true) { - vm_size_t vmsize; - vm_address_t address; + mach_vm_size_t vmsize; + mach_vm_address_t address; vm_region_basic_info_data_t info; vm_region_flavor_t flavor = VM_REGION_BASIC_INFO; memory_object_name_t object; @@ -88,8 +88,10 @@ void reportMemoryMap() { mach_vm_region(mach_task_self(), &address, &vmsize, flavor, (vm_region_info_t)&info, &info_count, &object); if (kr == KERN_SUCCESS) { - debugBelch("%08lx-%08lx %8zuK %c%c%c/%c%c%c\n", - address, (address + vmsize), (vmsize >> 10), + debugBelch("%p-%p %8zuK %c%c%c/%c%c%c\n", + (void *) address, + (void *) (address + vmsize), + ((size_t) vmsize) >> 10, (info.protection & VM_PROT_READ) ? 'r' : '-', (info.protection & VM_PROT_WRITE) ? 'w' : '-', (info.protection & VM_PROT_EXECUTE) ? 'x' : '-', |