Sign in to follow this  

calculating the size of a linked list

This topic is 4039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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,

Share this post


Link to post
Share on other sites

This topic is 4039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this