Re:Building SQLite with a small swarm
by gzread on Monday February 16, 2026 @06:58AM
(#47033965)
assuming your malloc function returns NULL when out of memory. Linux systems don't. They return fake addresses that kill your program when you use them.
[ Parent
| on HN ]
Re:Building SQLite with a small swarm
by formerly_proven on Monday February 16, 2026 @07:38AM
(#47034270)
That's not how Linux memory management works, there are no poison values. Allocations are deferred until referenced (by default) and when a deferred allocation fails that's when you get a signal. The system isn't giving you a "fake address" via mmap.
My interpretation of the GP comment is that you are saying the same thing. Linux will return a pointer that is valid for your address space mappings, but might not be safe to actually use, because of VM overcommit. Unixes in general have no way to tell the process how much heap can be safely allocated.