> Using heap, which requires a system call to get more memory
(It doesn't affect the main point of Paul's reply but just for academic
interest) no it doesn't:
[EMAIL PROTECTED]:~/playpen$ cat ten-thousand-mallocs.c
#include <stdlib.h>
int main() {
for (int ii = 0; ii != 10 * 1000; ++ ii) {
free(malloc(1));
}
}
[EMAIL PROTECTED]:~/playpen$ g++ ten-thousand-mallocs.c
[EMAIL PROTECTED]:~/playpen$ strace ./a.out 2>&1 | wc -l
152
[EMAIL PROTECTED]:~/playpen$
Even in less contrived applications, brk isn't called anything like as
often as malloc.
-------------------------------------
Martin's Outlook, BlueArc Engineering
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make