• 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: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation


  • Subject: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • From: Greg Parker <email@hidden>
  • Date: Thu, 19 Feb 2009 12:00:17 -0800

On Feb 19, 2009, at 10:29 AM, Leo Singer wrote:
I would rather not dynamically allocate that particular array because
the Cocoa application I am developing is simply a wrapper for a cross
platform C++ project.  This particular project has to manage a number
of different resources, including an SQLite database connection, an
open file, and a serial port device.  In order to keep error handling
as simple as possible, I have made heavy use of the RIAA pattern.  If
a serial port error occurs, for example, an exception gets thrown.  As
a result, the objects representing both the database and the open file
go out of scope, and their resources are released.

It's not hard to write a wrapper object for the malloc() block that calls free() when destructed. That would work just like your database wrapper object and your file wrapper object.



-- Greg Parker email@hidden Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Leo Singer <email@hidden>)
 >Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Michael Vannorsdel <email@hidden>)
 >Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Greg Parker <email@hidden>)
 >Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Leo Singer <email@hidden>)

  • Prev by Date: Spotlight-Like Menu-Item - How To?
  • Next by Date: Trouble with NSToolbar
  • Previous by thread: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • Next by thread: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • Index(es):
    • Date
    • Thread