Jan Sch�fer <[EMAIL PROTECTED]> writes:

> any ideas why this does happen?

The most likely cause is that your program spends 95% of its time
in libc, and you did not link with a profiling version of libc
(you'll need glibc-prof package installed).

To understand this better, compile/run the test below, examine
gprof output, then relink it with /usr/lib/libc_p.a and repeat.

Cheers,

--- cut ---
#include <string.h>
#include <stdlib.h>

void foo(int count)
{
    int i;
    char buf[10240];
    for (i = 0; i < count; ++i)
        memset(buf, 0, sizeof(buf));
}

int main(int argc, char *argv[])
{
    int i, count = 1000000;
    if (argc > 1) count = atoi(argv[1]);
    foo(count);
    return 0;
}
--- cut ---

-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to