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:
rfm 2009-09-07 09:53:27 +00:00
parent b58c9eb9c8
commit c666d14923
3 changed files with 32 additions and 0 deletions

View file

@ -405,6 +405,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
{
GSRunLoopCtxt *context;
GSIArray watchers;
unsigned i;
context = NSMapGet(_contextMap, mode);
if (context == nil)
@ -415,6 +416,13 @@ static inline BOOL timerInvalidated(NSTimer *t)
}
watchers = context->watchers;
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
@ -840,6 +848,13 @@ static inline BOOL timerInvalidated(NSTimer *t)
* all each time -limitDateForMode: is called.
*/
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);
}
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);
}