home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: How to allocate memory nicely?
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <C0DwAL.2L5@unx.sas.com>
- Date: Tue, 5 Jan 1993 14:01:33 GMT
- References: <1iasdiINN754@uniwa.uwa.edu.au>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 27
-
-
- In article <1iasdiINN754@uniwa.uwa.edu.au>, gujn@uniwa.uwa.edu.au (Jeremy Nelson) writes:
- |> This is probably a simple question for the programmers, so reply by news
- |> or mail as you see fit...
- |>
- |> How should I allocate memory for short strings of, say, 15 characters or
- |> so without unnecessarily fragmenting the memory? Should I request 1k
- |> chunks and doll it out as necessary? And how small is too small?
- |>
- |> Help from the experienced would be appreciated. Thanks. (I'm talking
- |> C of course. :)
-
- I suggest using malloc(). malloc() should allocate fairly large chunks
- and dole them out for you (depending, of course, on whose implementation
- of malloc() you are using.)
-
- |> Jem. Jeremy Nelson. gujn@uniwa.uwa.edu.au :\ => :)
-
- --
- *****
- =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
- *|. o.| || 1200/2400/9600 Dual
- | o |// For all you do, this bug's for you!
- ======
- usenet: walker@unx.sas.com bix: djwalker
- Any opinions expressed are mine, not those of SAS Institute, Inc.
-
-