Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
22 years ago

malloc and free

Hi:

I'm starting a new project using NIOS II. This project requires a doubly linked list to manage some of the data in the system. It looks like a good design for the linked list is to use malloc() and free().

My question does anyone have an idea as to how much overhead is associated with calls to malloc and free??

Also how much memory fragmentation can I expect and has that been a problem??

Thanks

George

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The version of malloc and free that is shipped with the libc archive is very good at avoiding fragmenetation ,in other words it has a very good coelescing algorithm

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Did ramsripathi's answer solve your problem/question?

    If not, post a reply and we'll look into it further.