mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Add warning logs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28620 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b58c9eb9c8
commit
c666d14923
3 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2009-09-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSRunLoop.m:
|
||||||
|
* Source/GSRunLoopCtxt.h:
|
||||||
|
Add some logging to help debug problems where code is adding too
|
||||||
|
many events into a run loop.
|
||||||
|
|
||||||
2009-09-06 Richard Frith-Macdonald <rfm@gnu.org>
|
2009-09-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSLock.m: Fix the ([-tryLock]) and [(-lockBeforeDate:])
|
* Source/NSLock.m: Fix the ([-tryLock]) and [(-lockBeforeDate:])
|
||||||
|
|
|
@ -62,8 +62,11 @@ typedef struct{
|
||||||
void *extra; /** Copy of the RunLoop ivar. */
|
void *extra; /** Copy of the RunLoop ivar. */
|
||||||
NSString *mode; /** The mode for this context. */
|
NSString *mode; /** The mode for this context. */
|
||||||
GSIArray performers; /** The actions to perform regularly. */
|
GSIArray performers; /** The actions to perform regularly. */
|
||||||
|
unsigned maxPerformers;
|
||||||
GSIArray timers; /** The timers set for the runloop mode */
|
GSIArray timers; /** The timers set for the runloop mode */
|
||||||
|
unsigned maxTimers;
|
||||||
GSIArray watchers; /** The inputs set for the runloop mode */
|
GSIArray watchers; /** The inputs set for the runloop mode */
|
||||||
|
unsigned maxWatchers;
|
||||||
NSTimer *housekeeper; /** Housekeeping timer for loop. */
|
NSTimer *housekeeper; /** Housekeeping timer for loop. */
|
||||||
@private
|
@private
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
|
|
|
@ -405,6 +405,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
||||||
{
|
{
|
||||||
GSRunLoopCtxt *context;
|
GSRunLoopCtxt *context;
|
||||||
GSIArray watchers;
|
GSIArray watchers;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
context = NSMapGet(_contextMap, mode);
|
context = NSMapGet(_contextMap, mode);
|
||||||
if (context == nil)
|
if (context == nil)
|
||||||
|
@ -415,6 +416,13 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
||||||
}
|
}
|
||||||
watchers = context->watchers;
|
watchers = context->watchers;
|
||||||
GSIArrayAddItem(watchers, (GSIArrayItem)((id)item));
|
GSIArrayAddItem(watchers, (GSIArrayItem)((id)item));
|
||||||
|
i = GSIArrayCount(watchers);
|
||||||
|
if (i % 1000 == 0 && i > context->maxWatchers)
|
||||||
|
{
|
||||||
|
context->maxWatchers = i;
|
||||||
|
NSLog(@"WARNING ... there are %u watchers scheduled in mode %@ of %@",
|
||||||
|
i, mode, self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _checkPerformers: (GSRunLoopCtxt*)context
|
- (void) _checkPerformers: (GSRunLoopCtxt*)context
|
||||||
|
@ -840,6 +848,13 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
||||||
* all each time -limitDateForMode: is called.
|
* all each time -limitDateForMode: is called.
|
||||||
*/
|
*/
|
||||||
GSIArrayAddItem(timers, (GSIArrayItem)((id)timer));
|
GSIArrayAddItem(timers, (GSIArrayItem)((id)timer));
|
||||||
|
i = GSIArrayCount(timers);
|
||||||
|
if (i % 1000 == 0 && i > context->maxTimers)
|
||||||
|
{
|
||||||
|
context->maxTimers = i;
|
||||||
|
NSLog(@"WARNING ... there are %u timers scheduled in mode %@ of %@",
|
||||||
|
i, mode, self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1484,6 +1499,13 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
||||||
{
|
{
|
||||||
GSIArrayInsertItem(performers, (GSIArrayItem)((id)item), i);
|
GSIArrayInsertItem(performers, (GSIArrayItem)((id)item), i);
|
||||||
}
|
}
|
||||||
|
i = GSIArrayCount(performers);
|
||||||
|
if (i % 1000 == 0 && i > context->maxPerformers)
|
||||||
|
{
|
||||||
|
context->maxPerformers = i;
|
||||||
|
NSLog(@"WARNING ... there are %u performers scheduled"
|
||||||
|
@" in mode %@ of %@", i, mode, self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RELEASE(item);
|
RELEASE(item);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue