home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Newsgroups: comp.lang.c
- Subject: Re: good memory allocation strategies?
- Message-ID: <1992Jul22.091155.26357@klaava.Helsinki.FI>
- Date: 22 Jul 92 09:11:55 GMT
- References: <1992Jul21.214115.28569@tamsun.tamu.edu>
- Organization: University of Helsinki
- Lines: 24
-
- tsmith@cs.tamu.edu writes:
- >1) Is it reasonable (in general) to ask the user to live with a big
- >limit?
-
- I think not, but your mileage may vary.
-
- >2) How much of a speed penalty does dynamic allocation really impose?
-
- Depends. You need to measure your own system.
-
- One common situation is that you have a lot of allocations for list
- nodes etc, all of the same size and type. In this case a speed hack
- that is often mentioned is that you don't really free the nodes when
- they are no longer needed, instead you manage a list of available
- allocated nodes. When allocating a new node, you check your list of
- free nodes first, and only after that use malloc if necessary.
-
- >3) How serious of a problem can memory fragmentation be on a modern
- >workstation?
-
- Personally, I wouldn't worry about it. Again, your mileage may vary.
-
- --
- Lars.Wirzenius@helsinki.fi
-