0

When you use c++ new for an iPhone app does it optimize the call at all to minimize fragmentation(without implementing any manual memory management)? For example I've heard that iPhone supports a special type of virtual memory.

Ryan
  • 5,883
  • 13
  • 56
  • 93
  • 1
    You don't use C++ for a native iPhone app. It is Objective-C. – nmagerko Nov 18 '11 at 02:14
  • 3
    You can use C++ for an iPhone app. I do it all the time. – Ryan Nov 18 '11 at 02:15
  • @nmagerko You can use Objective-C++ to develop iPhone apps. – millimoose Nov 18 '11 at 02:16
  • @Inerdia: Objective-C++ is *not* C++. **C++ is C++**. It's like saying C and C++, or C and Objective-C are the same thing because one extends another, i.e.: this is not true, they are different languages with different semantics and constructs. – netcoder Nov 18 '11 at 02:34
  • Why would you care about fragmentation? This is the OS responsibiltiy, not yours. – ABCD Nov 18 '11 at 04:31
  • I'm making a video game and all the game programming books I read stress custom memory management. – Ryan Nov 18 '11 at 04:49
  • 2
    A lot of video game development books/practices are based on when memory was measured in killobytes. Main memory on the PS2 is only 32 megabytes and one of those was reserved for the system libraries. Even on mobile devices, fragmentation isn't nearly as big of a problem as it used to be. – IronMensan Nov 18 '11 at 06:09
  • @netcoder Which of the differences in semantics between ObjC++ and C++ are relevant to the question? – millimoose Nov 18 '11 at 14:50
  • @Ryan iOS is a "real" operating system – it's likely it's `malloc()` implementation is the one OS X uses, which does try to prevent fragmentation: http://cocoawithlove.com/2010/05/look-at-how-malloc-works-on-mac.html – millimoose Nov 18 '11 at 21:26

0 Answers0