• 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: does Leaks instrument not work correctly with C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does Leaks instrument not work correctly with C++?


  • Subject: Re: does Leaks instrument not work correctly with C++?
  • From: Nathan Ramella <email@hidden>
  • Date: Sun, 1 Mar 2009 13:19:12 -0800

Hi Dave,

leaks shows me a leak in that program. I'm on 10.5.x intel with latest xcode.

$ leaks a.out | grep Leak | wc -l
       2
$ leaks a.out | grep Leak | wc -l
       3
$ leaks a.out | grep Leak | wc -l
       4
$ leaks a.out | grep Leak | wc -l
       5
$ leaks a.out | grep Leak | wc -l
       6

On Mar 1, 2009, at 7:23 AM, email@hidden wrote:


Xcode version 3.1.2 (that came with the 2.2.1 iPhone SDK)

I tried the leak instrument on my iPhone app and was impressed how nice it was to use - pointed out two small memory leaks I had missed.

I teach C++ programming at the college level and was thinking about showing my students how to use it (more and more of them have Macs and we also have a Mac Mini lab), but it doesn't seem to work well with C++. Am I doing something wrong or this is a known issue?

Here's a simple program that Leaks does not report any leaks (although you can tell from ObjectAlloc that the memory usage continued to grow).

#include <iostream>
using namespace std;

int main (int argc, char * const argv[]) {

   int *p;

   for (int i=0; i<10; ++i) {
       cout << i << endl;
       p = new int[256];
       sleep(2);
   }

   return 0;
}

Thanks,
Dave

_______________________________________________
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



_______________________________________________
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: does Leaks instrument not work correctly with C++?
      • From: Dave Reed <email@hidden>
References: 
 >does Leaks instrument not work correctly with C++? (From: email@hidden)

  • Prev by Date: does Leaks instrument not work correctly with C++?
  • Next by Date: Re: Subversion with xcode problems
  • Previous by thread: does Leaks instrument not work correctly with C++?
  • Next by thread: Re: does Leaks instrument not work correctly with C++?
  • Index(es):
    • Date
    • Thread