mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 17:50:47 +00:00
Turn release messages sent to autorelease pools into drain messages. No
functionality change in non-GC mode, in GC mode it invokes a quick GC pass to try to delete the short-lived objects. Also deleted some [pool release] lines just before exit() or return-from-main statements. These cause objects to be swapped in and destructors to be run to no benefit (the OS will reclaim this memory without requiring stuff to be swapped in when the process exits). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33146 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ac36e417ea
commit
dbd4c1b77c
15 changed files with 23 additions and 28 deletions
|
@ -90,7 +90,7 @@ NSApplicationMain(int argc, const char **argv)
|
||||||
|
|
||||||
DESTROY(NSApp);
|
DESTROY(NSApp);
|
||||||
|
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1156,7 +1156,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
|
||||||
[self _gs_startAnimationInOwnLoop];
|
[self _gs_startAnimationInOwnLoop];
|
||||||
NSDebugMLLog(@"NSAnimationThread",
|
NSDebugMLLog(@"NSAnimationThread",
|
||||||
@"End of %@", [NSThread currentThread]);
|
@"End of %@", [NSThread currentThread]);
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
_isThreaded = NO;
|
_isThreaded = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1181,11 +1181,11 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
|
||||||
d = [loop limitDateForMode: NSAnimationBlockingRunLoopMode];
|
d = [loop limitDateForMode: NSAnimationBlockingRunLoopMode];
|
||||||
if (d == nil)
|
if (d == nil)
|
||||||
{
|
{
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
break; // No inputs and no timers.
|
break; // No inputs and no timers.
|
||||||
}
|
}
|
||||||
[NSThread sleepUntilDate: d];
|
[NSThread sleepUntilDate: d];
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -770,7 +770,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
||||||
/* Cache the NSAutoreleasePool class */
|
/* Cache the NSAutoreleasePool class */
|
||||||
arpClass = [NSAutoreleasePool class];
|
arpClass = [NSAutoreleasePool class];
|
||||||
nc = [NSNotificationCenter defaultCenter];
|
nc = [NSNotificationCenter defaultCenter];
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
|
||||||
[inv invoke];
|
[inv invoke];
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -915,7 +915,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
||||||
/* We are the end of responder chain. */
|
/* We are the end of responder chain. */
|
||||||
[self setNextResponder: nil];
|
[self setNextResponder: nil];
|
||||||
|
|
||||||
RELEASE(_app_init_pool);
|
[_app_init_pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1919,7 +1919,7 @@ See Also: -runModalForWindow:
|
||||||
[self stopModal];
|
[self stopModal];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RELEASE (pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSAssert(_session == theSession, @"Session was changed while running");
|
NSAssert(_session == theSession, @"Session was changed while running");
|
||||||
|
|
|
@ -1595,7 +1595,7 @@ static NSMutableDictionary *cachedCSets = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) fixParagraphStyleAttributeInRange: (NSRange)range
|
- (void) fixParagraphStyleAttributeInRange: (NSRange)range
|
||||||
|
|
|
@ -2438,7 +2438,7 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
||||||
//[new setColor: c atX: i y: j];
|
//[new setColor: c atX: i y: j];
|
||||||
setC(new, setCSel, c, i, j);
|
setC(new, setCSel, c, i, j);
|
||||||
}
|
}
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ static GSComboWindow *gsWindow = nil;
|
||||||
|
|
||||||
_stopped = NO;
|
_stopped = NO;
|
||||||
|
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
// onWindow notifications
|
// onWindow notifications
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
self = [self initSymbolicLinkWithDestination:
|
self = [self initSymbolicLinkWithDestination:
|
||||||
[fm pathContentOfSymbolicLinkAtPath: path]];
|
[fm pathContentOfSymbolicLinkAtPath: path]];
|
||||||
}
|
}
|
||||||
RELEASE(arp);
|
[arp drain];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -464,7 +464,7 @@ static NSInputManager *currentInputManager = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASE (pool);
|
[pool drain];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -855,7 +855,7 @@ static NSMutableDictionary* printerCache;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Release the local autoreleasePool
|
// Release the local autoreleasePool
|
||||||
RELEASE(subpool);
|
[subpool drain];
|
||||||
|
|
||||||
|
|
||||||
//Sometimes it's good to see the tables...
|
//Sometimes it's good to see the tables...
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
|
|
||||||
[self animate: self];
|
[self animate: self];
|
||||||
[NSThread sleepForTimeInterval: _animationDelay];
|
[NSThread sleepForTimeInterval: _animationDelay];
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2699,7 +2699,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
GSRemoveIcon(mini);
|
GSRemoveIcon(mini);
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1188,7 +1188,7 @@
|
||||||
|
|
||||||
[self _setAttributesOfLastRun: attributes];
|
[self _setAttributesOfLastRun: attributes];
|
||||||
|
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self _setAttributesOfLastRun: nil]; // cleanup, should be unneccessary
|
[self _setAttributesOfLastRun: nil]; // cleanup, should be unneccessary
|
||||||
|
|
|
@ -533,6 +533,6 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
RELEASE(aSpellChecker);
|
RELEASE(aSpellChecker);
|
||||||
RELEASE(aServer);
|
RELEASE(aServer);
|
||||||
RELEASE(_pool);
|
[_pool drain];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,6 @@ main(int argc, char** argv, char **env_c)
|
||||||
if (proc == nil)
|
if (proc == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"unable to get process information!");
|
NSLog(@"unable to get process information!");
|
||||||
[pool release];
|
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +203,7 @@ main(int argc, char** argv, char **env_c)
|
||||||
{
|
{
|
||||||
if (verbose > 0)
|
if (verbose > 0)
|
||||||
NSLog(@"couldn't create %@", usrRoot);
|
NSLog(@"couldn't create %@", usrRoot);
|
||||||
[pool release];
|
[pool drain];
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +263,6 @@ main(int argc, char** argv, char **env_c)
|
||||||
{
|
{
|
||||||
if (verbose > 0)
|
if (verbose > 0)
|
||||||
NSLog(@"couldn't write %@", str);
|
NSLog(@"couldn't write %@", str);
|
||||||
[pool release];
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,12 +287,10 @@ main(int argc, char** argv, char **env_c)
|
||||||
{
|
{
|
||||||
if (verbose > 0)
|
if (verbose > 0)
|
||||||
NSLog(@"couldn't write %@", str);
|
NSLog(@"couldn't write %@", str);
|
||||||
[pool release];
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,7 +759,7 @@ scanApplications(NSMutableDictionary *services, NSString *path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[arp release];
|
[arp drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -815,7 +811,7 @@ scanDynamic(NSMutableDictionary *services, NSString *path)
|
||||||
NSLog(@"bad app info - %@", infPath);
|
NSLog(@"bad app info - %@", infPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[arp release];
|
[arp drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -890,7 +886,7 @@ scanServices(NSMutableDictionary *services, NSString *path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[arp release];
|
[arp drain];
|
||||||
}
|
}
|
||||||
|
|
||||||
static NSMutableArray*
|
static NSMutableArray*
|
||||||
|
|
|
@ -54,7 +54,6 @@ main(int argc, char** argv, char **env)
|
||||||
if (proc == nil)
|
if (proc == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"unable to get process information!\n");
|
NSLog(@"unable to get process information!\n");
|
||||||
[pool release];
|
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +92,7 @@ main(int argc, char** argv, char **env)
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Nothing to do.\n");
|
NSLog(@"Nothing to do.\n");
|
||||||
RELEASE(pool);
|
[pool drain];
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue