On 24/01/15 10:10, Howard Chu wrote: >> We could drop memalign. malloc(desired space + 1 OS page), then >> adjust for alignment. On machines with a sane linear address >> space where we can tell alignment from the address, anyway. > > Such an address space is already a requirement for LMDB, since mmaps > are page-aligned.
I may have used the wrong word. mmap() must align, but that's no reason (size_t)pointer has to look sane. If it wants, the machine can still have PDP-endian descending address representation with a checkbit as every 4th bit, while running in a mode with big- endian integers, all of which shows up in (size_t)pointer. Anyway, the branch now tries to test for sane-looking addresses.
