• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cocoa-dev digest, Vol 1 #345 - 15 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 1 #345 - 15 msgs


  • Subject: Re: cocoa-dev digest, Vol 1 #345 - 15 msgs
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Wed, 1 Aug 2001 21:09:12 -0300

>From: Ondra Cada <email@hidden>
>Date: Wed, 1 Aug 2001 13:59:06 +0200
>
>BY> but will cause memory leaks if you've malloc'd something or
>
>This it would, so you should never use explicit malloc -- always wrap it
>into an object (which can be autoreleased).

Hmmm... excuse me, but I can't quite understand why.

If I need a 1 or 2K buffer for a couple of lines to get some result from a Carbon call, why shouldn't I malloc it before the call, copy the buffer's contents to some object, and then free it again?

How would this "wrapping into an object" look like? And then I'd have to get a C pointer to its contents, anyway...


--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)


  • Prev by Date: Re: UTCDateTime????
  • Next by Date: Re: Text Sizing
  • Previous by thread: Re: Searchable archives
  • Next by thread: Re: Looping worker threads - NSString vs sprintf
  • Index(es):
    • Date
    • Thread