mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Implement CRASH_ON_ZOMBIE for memory debugging
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23267 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8094f44311
commit
325987015c
3 changed files with 27 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
||||||
* Source/GSFormat.m: optimise a bit and fix bug where utf8 (and other
|
* Source/GSFormat.m: optimise a bit and fix bug where utf8 (and other
|
||||||
multibyte encodings) strings could be truncated at the wrong
|
multibyte encodings) strings could be truncated at the wrong
|
||||||
precision.
|
precision.
|
||||||
|
* Source/NSObject.m: implement CRASH_ON_ZOMBIE
|
||||||
|
* Documentation/Base.gsdoc: document it.
|
||||||
|
|
||||||
2006-08-12 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-08-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -261,6 +261,24 @@ notice and this notice are preserved.
|
||||||
variable will cause the program to generate a core dump.
|
variable will cause the program to generate a core dump.
|
||||||
</p>
|
</p>
|
||||||
</desc>
|
</desc>
|
||||||
|
<term>CRASH_ON_ZOMBIE</term>
|
||||||
|
<desc>
|
||||||
|
<p>
|
||||||
|
When the a message is sent to a zombie object (see the
|
||||||
|
<code>NSZombieEnabled</code> environment variable) the
|
||||||
|
base library allows you to specify whether the program
|
||||||
|
should continue after logging the message, or have the
|
||||||
|
program abort.<br />
|
||||||
|
By default, the program will attempt to continue.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The <code>CRASH_ON_ZOMBIE</code> variable can be used to
|
||||||
|
override this behavior. If this is defined to <em>YES</em>,
|
||||||
|
<em>TRUE</em>, or <em>1</em> then the program will log the
|
||||||
|
message sent to the zombie and then abort, producing a
|
||||||
|
core dump on systems where that is possible.
|
||||||
|
</p>
|
||||||
|
</desc>
|
||||||
<term>GNUSTEP_STRING_ENCODING</term>
|
<term>GNUSTEP_STRING_ENCODING</term>
|
||||||
<desc>
|
<desc>
|
||||||
<p>
|
<p>
|
||||||
|
@ -405,7 +423,9 @@ notice and this notice are preserved.
|
||||||
You can set a breakpoint in this function and examine the
|
You can set a breakpoint in this function and examine the
|
||||||
process memory if you are running under a debugger.<br />
|
process memory if you are running under a debugger.<br />
|
||||||
As this overrides actual object deallocation, all memory
|
As this overrides actual object deallocation, all memory
|
||||||
allocated for objects will be leaked!
|
allocated for objects will be leaked!<br />
|
||||||
|
You can use the <code>CRASH_ON_ZOMBIE</code> environment
|
||||||
|
variable to force an abort afdter the message is logged.
|
||||||
</p>
|
</p>
|
||||||
</desc>
|
</desc>
|
||||||
<term>SOCKS5_SERVER</term>
|
<term>SOCKS5_SERVER</term>
|
||||||
|
|
|
@ -147,6 +147,10 @@ static void GSLogZombie(id o, SEL sel)
|
||||||
NSLog(@"Deallocated %@ (0x%x) sent %@",
|
NSLog(@"Deallocated %@ (0x%x) sent %@",
|
||||||
NSStringFromClass(c), o, NSStringFromSelector(sel));
|
NSStringFromClass(c), o, NSStringFromSelector(sel));
|
||||||
}
|
}
|
||||||
|
if (GSEnvironmentFlag("CRASH_ON_ZOMBIE", NO) == YES)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue