calculating the size of a linked list
Hi,
I would like to be able to calculate the memory in use by my linked list, problem is, if i just add all the mallocs i do for every node i add i just get the size of the empty node, and seeing as all the members are pointers, i would get x times a pointer size.
It would seem more proper to count the nodes and the memory they use as well right ? These members however are malloced by strdup, so i'm not sure how much they take and i'm also not sure how i would go about this.
Any suggestions most welcome!
gr,
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement