• 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: A malloc error in C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A malloc error in C++


  • Subject: Re: A malloc error in C++
  • From: "Shawn Erickson" <email@hidden>
  • Date: Wed, 29 Aug 2007 08:06:01 -0700

On 8/29/07, Clark Cox <email@hidden> wrote:

> Here's your problem. Why are you trying to call the destructor directly?
>
> ...
> >      zAnalysis.~DataAnalysis();

Giacomo consider doing the following since you are using stack
allocated objects... wrapping them in blocks will scope the life time
of stack allocated objects in that block (of course the compiler would
like see this for itself and may terminate the life times early).

{
    GMNLFS::DataAnalysis<vector<double>::iterator,double>
zAnalysis(z.begin(),z.end());
    ...
    zAnalysis.~DataAnalysis();
}

{
    GMNLFS::DataAnalysis<vector<double>::iterator,double>
mvAnalysis(mv.begin(),mv.end());
    ...
    mvAnalysis.~DataAnalysis();
}

... etc ...

...or switch to using heap allocated objects using new and delete to
manage their lifetimes.

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: A malloc error in C++
      • From: "Shawn Erickson" <email@hidden>
References: 
 >A malloc error in C++ (From: Giacomo Monari <email@hidden>)
 >Re: A malloc error in C++ (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: A malloc error in C++
  • Next by Date: Re: A malloc error in C++
  • Previous by thread: Re: A malloc error in C++
  • Next by thread: Re: A malloc error in C++
  • Index(es):
    • Date
    • Thread