Remove code that relies on sbrk()

Dag-Erling Smørgrav des at
Fri Nov 18 11:39:01 UTC 2016

Unbound pretends to report memory statistics based on the value returned
by sbrk().  Not only is this non-portable (as demonstrated by r3528 and
r3911), but it is completely meaningless even on systems that provide
the sbrk() function.  First, modern allocators (and by "modern" I mean
"anything written in the last 10-15 years") use mmap(), not sbrk(), to
manage address space.  Second, even with allocators that do rely on
sbrk(), it only tells you how much address space is available to the
program, not how much of it is currently or has ever been used.  The
attached patch removes all traces of sbrk() from the code.

Dag-Erling Smørgrav - des at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: unbound-sbrk.diff
Type: text/x-patch
Size: 7412 bytes
Desc: not available
URL: <>

More information about the Unbound-users mailing list