hello all
i want to know in my program the amount of memory allocated by
malloc() calls
so i "overloaded" the malloc functions to increment a counter of
memory used (no call to free is done).
this counter is incremented each time a malloc is done by the number
of requested machine words.
The problem is that when i do a "ps aux" the amount of memory
allocated for my program is quite different from the amount i computed
manually.
So my question is : what does really do a malloc call?
for example if i do this
ptr = malloc(sizeof(char) * 65);
am i sure that (assuming a machine word = 4 bytes and 1 char = 1 byte)
the memory allocated will be of 68 bytes?
any help would be appreciated
Sami Evangelista