Do not shadow variable, use deprecated MAP_ANON if MAP_ANONYMOUS is not defined #9063
pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20161102_fix_lockedpool changing 1 files +10 −3-
paveljanik commented at 1:19 pm on November 2, 2016: contributorTwo minor fixes after merging #8753.
-
Do not shadow variable, use deprecated MAP_ANON if MAP_ANONYMOUS is not defined. 4a9f3c50cc
-
in src/support/lockedpool.cpp: in 4a9f3c50cc
223@@ -224,6 +224,13 @@ PosixLockedPageAllocator::PosixLockedPageAllocator() 224 page_size = sysconf(_SC_PAGESIZE); 225 #endif 226 } 227+ 228+// Some systems (at least OS X) do not define MAP_ANONYMOUS yet and define 229+// MAP_ANON which is deprecated
laanwj commented at 1:21 pm on November 2, 2016:If MAP_ANON is deprecated, what is the new name?
Also: this passed Travis, how is that possible if it didn’t exist on MacOSX?
jonasschnelli commented at 1:23 pm on November 2, 2016: contributorutACK
FreeBSD manpage
0 MAP_ANON Map anonymous memory not associated with any specific 1 file. The file descriptor used for creating MAP_ANON 2 must be -1. The offset argument must be 0. 3 4 MAP_ANONYMOUS This flag is identical to MAP_ANON and is provided for 5 compatibility.
Linux manpage
0MAP_ANONYMOUS 1 The mapping is not backed by any file; the fd and offset arguments are ignored. This flag in conjunction with MAP_SHARED is implemented since Linux 2.4. 2MAP_ANON 3 Alias for MAP_ANONYMOUS. Deprecated.
OSX 10.11 manpage
0 MAP_ANONYMOUS Synonym for MAP_ANON. 1 2 MAP_ANON Map anonymous memory not associated with any specific file. The offset argument is ignored. Mac OS X spe- 3 cific: the file descriptor used for creating MAP_ANON regions can be used to pass some Mach VM flags, and can 4 be specified as -1 if no such flags are associated with the region. Mach VM flags are defined in 5 <mach/vm_statistics.h> and the ones that currently apply to mmap are:
laanwj commented at 1:24 pm on November 2, 2016: memberSo apparently all three OSes support MAP_ANONYMOUS? What am I missing?paveljanik commented at 1:25 pm on November 2, 2016: contributorMy build machine is 10.10.jonasschnelli commented at 1:27 pm on November 2, 2016: contributor@paveljanik what does you 10.10sman mmap
tells you aboutMAP_ANONYMOUS
? IMO travis compiles against 10.9… hmm..paveljanik commented at 1:28 pm on November 2, 2016: contributor@jonasschnelli Nothing…
man mmap | grep ANON
:0 MAP_ANON Map anonymous memory not associated with any specific 1 cific: the file descriptor used for creating MAP_ANON 2 [ENODEV] MAP_ANON has not been specified and the file fd refers 3 the process. MAP_ANON was specified and insufficient
laanwj commented at 1:30 pm on November 2, 2016: memberThat’s really strange. I really don’t understand MacOSX’ deprecation policy, from release to release it seems to oscillate wildly. In any case utACK.paveljanik commented at 1:38 pm on November 2, 2016: contributorInteresting:
0$ grep ANON /usr/include/sys/mman.h 1#define MAP_ANON 0x1000 /* allocated from memory, swap space */ 2$
but
0/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/mman.h:#define MAP_ANONYMOUS MAP_ANON 1/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/share/man/man2/mmap.2:.It Dv MAP_ANONYMOUS 2/Applications/Xcode.app//Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/usr/include/sys/mman.h:#define MAP_ANONYMOUS MAP_ANON 3/Applications/Xcode.app//Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS2.1.sdk/usr/include/sys/mman.h:#define MAP_ANONYMOUS MAP_ANON
paveljanik commented at 1:40 pm on November 2, 2016: contributorWe are not alone: https://gmtk-trac.bitnamiapp.com/trac/gmtk/ticket/371 and others…laanwj merged this on Nov 2, 2016laanwj closed this on Nov 2, 2016
laanwj referenced this in commit f2a6e8243f on Nov 2, 2016codablock referenced this in commit 0b4caeeb3d on Sep 19, 2017codablock referenced this in commit 85c5aea08b on Jan 13, 2018andvgal referenced this in commit 5ea5aa793c on Jan 6, 2019CryptoCentric referenced this in commit 3fc4bc129c on Feb 15, 2019zkbot referenced this in commit 5ef5d8d268 on Jul 31, 2020zkbot referenced this in commit 7d94064616 on Sep 29, 2020MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me