• 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
LLVM, STL and ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LLVM, STL and ARC


  • Subject: LLVM, STL and ARC
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Thu, 09 Jan 2014 14:25:25 +0000
  • Thread-topic: LLVM, STL and ARC

Using Xcode 5.0.2 on OS 10.8.5, I have an Objective-C++ ARC Foundation project that uses std::vector (actually a 2-D matrix).  This matrix is generated in pieces, using separate NSOperations which report back, at the end of main(), as follows:

NSValue *value = [NSValue valueWithPointer:[mcmc getOutput]];

NSDictionary *data = "" style="color: #703daa">NSDictionary dictionaryWithObjectsAndKeys:value, @"output", nil];

[nc postNotificationName:@"doneSolve" object:nil userInfo:data];


On the (unique) receiving end, I have

@synchronized(self) {

   NSValue *output = [[notif userInfo] objectForKey:@"output"];

   vector< vector<double> > *outData = (vector< vector<double> >*)[output pointerValue];

   Output.insert(Output.end(), outData->begin(), outData->end());

}


The receiver's final, complete Output matrix is initially OK but successive calls to NSLog()

NSLog(@"Output size = %lu", Output.size());


report monotonically decreasing sizes for the receiver's Output matrix which I suspect is some bug in ARC under these conditions.

If I change the C++ library from

LLVM C++ standard library

to

GNU C++ standard library

the problem goes away.

I could not tell, from my searches, whether this was supposed to be something that was fixed or not.  I realize that the insert() call requires some deep copying but I would have assumed that LLVM knew all about that.

I would welcome any help on this.  Thanks.

--
Michael P. McLaughlin
 _______________________________________________
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

  • Prev by Date: Re: In-Xcode performance meters
  • Next by Date: Re: WWDC App missing videos
  • Previous by thread: Re: WWDC App missing videos
  • Next by thread: data formatter running before object is allocated
  • Index(es):
    • Date
    • Thread