Re: General rules on interface (function) design
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Wed, 24 May 2006 10:30:36 -0400
Eric Sosman wrote:
.... snip ...
The original suggestion in this thread was that "local"
functions should not as a rule allocate dynamic memory. I'm
still unsure what "local" is supposed to mean, but does anyone
think it a bad idea for fopen() to call malloc()?
I certainly hope not. I suspect the OP considers statid functions
to be 'local' functions. At any rate I see no problem with such
animals calling malloc and friends, as long as they are clearly
documented as requiring an eventual free, or corresponding release
call. The latter may be necessary for things that have internal
levels, such as structures with pointers to strings.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
.
- Follow-Ups:
- Re: General rules on interface (function) design
- From: lovecreatesbeauty
- Re: General rules on interface (function) design
- References:
- General rules on interface (function) design
- From: lovecreatesbeauty
- Re: General rules on interface (function) design
- From: Richard Heathfield
- Re: General rules on interface (function) design
- From: Malcolm
- Re: General rules on interface (function) design
- From: Eric Sosman
- Re: General rules on interface (function) design
- From: Robert Latest
- Re: General rules on interface (function) design
- From: Eric Sosman
- General rules on interface (function) design
- Prev by Date: Re: Curses for win32 with VT100/ANSI support
- Next by Date: Re: What this mean? Compiler output
- Previous by thread: Re: General rules on interface (function) design
- Next by thread: Re: General rules on interface (function) design
- Index(es):
Relevant Pages
|