Added enumeration mutation function, called by code automatically inserted by the compiler when a collection mutates during fast enumeration.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28610 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2009-09-05 17:43:13 +00:00
parent 29faf077e7
commit 852e924f52
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2009-09-05 David Chisnall <csdavec@swan.ac.uk>
* Source/NSEnumberation.m: Added enumeration mutation callback.
2009-09-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSLock.m: Fix a few variable declarations to work with older

View file

@ -29,6 +29,8 @@
#import "GNUstepBase/preface.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSEnumerator.h"
#include "Foundation/NSException.h"
/**
* Simple class for iterating over a collection of objects, usually returned
@ -96,3 +98,14 @@
return len;
}
@end
/**
* objc_enumerationMutation() is called whenever a collection mutates in the
* middle of fast enumeration.
*/
void objc_enumerationMutation(id obj)
{
[NSException raise: NSGenericException
format: @"Collection %@ was mutated while being enumerated",
obj];
}