Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Memory leak/error tool for OS X?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="miggles" data-source="post: 45135" data-attributes="member: 5662"><p>I'm not so concerned about system level memory leaks as opposed to application level leaks. Imagine calling a C++ method that does nothing but allocate space, use it locally, but never delete it. Even though the system is safe from being harmed by this, the application may eventually kill itself when space runs out.</p><p></p><p><span style="font-family: 'Courier New'"></span></p><p><span style="font-family: 'Courier New'">void Blort()</span></p><p><span style="font-family: 'Courier New'">{</span></p><p><span style="font-family: 'Courier New'"> int *a = new int [10000];</span></p><p><span style="font-family: 'Courier New'"> a[0] = 5;</span></p><p><span style="font-family: 'Courier New'">}</span></p><p><span style="font-family: 'Courier New'"></span></p><p><span style="font-family: 'Courier New'">int main()</span></p><p><span style="font-family: 'Courier New'">{</span></p><p><span style="font-family: 'Courier New'"> while (1)</span></p><p><span style="font-family: 'Courier New'"> Blort();</span></p><p><span style="font-family: 'Courier New'"> return 0;</span></p><p><span style="font-family: 'Courier New'">}</span></p><p><span style="font-family: 'Courier New'"></span></p></blockquote><p></p>
[QUOTE="miggles, post: 45135, member: 5662"] I'm not so concerned about system level memory leaks as opposed to application level leaks. Imagine calling a C++ method that does nothing but allocate space, use it locally, but never delete it. Even though the system is safe from being harmed by this, the application may eventually kill itself when space runs out. [FONT=Courier New] void Blort() { int *a = new int [10000]; a[0] = 5; } int main() { while (1) Blort(); return 0; } [/FONT] [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Memory leak/error tool for OS X?
Top