Thread: Understanding Memory Allocation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Quote Originally Posted by JosephRagsdale
    I asked this question mainly because writing functions for freeing memory seems icky to me.
    not really that big a deal actually, most of the code is already done for you with that handy function free().

    Perhaps I'm too accustomed to a garbage collector
    JAVA?
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

  2. #2
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    Quote Originally Posted by caroundw5h
    not really that big a deal actually, most of the code is already done for you with that handy function free().
    Yes, but this thread is about cleaning up data structures that have had many malloc's associated with them, so you can't just do a single free() call to clean up.

  3. #3
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Quote Originally Posted by cwr
    so you can't just do a single free() call to clean up.
    true, but my point was imagine how much more annoying it would be if you had to code free from hand all the time. the function simplifies your life.
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dynamic memory allocation.
    By HAssan in forum C Programming
    Replies: 3
    Last Post: 09-07-2006, 05:04 PM
  2. Dynamic memory allocation...
    By dicorr in forum C Programming
    Replies: 1
    Last Post: 06-24-2006, 03:59 AM
  3. C memory allocation to c++
    By markucd in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2005, 05:56 AM
  4. memory allocation ptr to array? how?
    By kokopo2 in forum C Programming
    Replies: 8
    Last Post: 09-01-2005, 05:06 PM
  5. Memory allocation and deallocation
    By Micko in forum C++ Programming
    Replies: 3
    Last Post: 08-19-2005, 06:45 PM