Jump to content
  • Advertisement
Sign in to follow this  

calculating the size of a linked list

This topic is 4253 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!