C++ use of Malloc/Realloc and Free

Jerry Feldman gaf at blu.org
Sun Jun 22 16:15:57 EDT 2003


On Sun, 22 Jun 2003 09:21:26 -0700 (PDT)
Andrew Berkowitz <barzel at rocketmail.com> wrote:

> I almost feel guilty about having brought up the topic. Almost.
> 
> While using C-style memory management can be extremely dangerous,
> there are some situations where the benefits outweigh the risks. For
> most situations, standard constructors and destructors are easier and
> safer.
> 
> But when caching a lot of information, such as imaging
> information,being able to control and adjust the cache size provides
> optimal performance. This way, caches can be adjusted to fit the exact
> situation and resource availability.
> 
> So I agree with you that using malloc/free/realloc can be quite
> dangerous, there are some occasional times where the risks outweigh
> the danger. 
Yes, you are quite correct. The bottom line is that the programmer must
understand the issues. 

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20030622/4e8d82b9/attachment.sig>


More information about the Discuss mailing list