mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Try to make code more robust and comment copiously.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32107 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
efbbe74e26
commit
379f4f01bc
2 changed files with 44 additions and 25 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,8 +1,8 @@
|
||||||
2011-02-12 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-02-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSZombie.m: Get zombie class to set up class pointer in
|
* Source/NSObject.m: Obtain NSZombie class pointer using
|
||||||
+initialize rather than using +class since +class is not implemented
|
objc_lookUpClass() to avoid the use of NSString inside the NSObject
|
||||||
and David says support for it is runtime specific.
|
initialize method. Re-order code for safety. Add lots of comments.
|
||||||
|
|
||||||
2011-02-12 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-02-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
@ -487,14 +487,16 @@
|
||||||
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
* Headers/Foundation/NSCalendar.h:
|
* Headers/Foundation/NSCalendar.h:
|
||||||
* Source/NSCalendar.m: Added iOS 4.0 and later methods to NSDateComponents.
|
* Source/NSCalendar.m: Added iOS 4.0 and later methods
|
||||||
|
to NSDateComponents.
|
||||||
|
|
||||||
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
2010-12-31 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
* Resources/GNUmakefile:
|
* Resources/GNUmakefile:
|
||||||
* Resources/Languages/Locale.canonical: Added mapping to go from long
|
* Resources/Languages/Locale.canonical: Added mapping to go from long
|
||||||
locale identifiers to the shorter identifiers used by ICU.
|
locale identifiers to the shorter identifiers used by ICU.
|
||||||
* Source/NSLocale.m: Implemented -canonical* and -preferredLanaguges methods.
|
* Source/NSLocale.m: Implemented -canonical* and -preferredLanaguges
|
||||||
|
methods.
|
||||||
|
|
||||||
2010-12-31 14:03 David Chisnall <theraven@gna.org>
|
2010-12-31 14:03 David Chisnall <theraven@gna.org>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,6 @@ static Class NSConstantStringClass;
|
||||||
{
|
{
|
||||||
Class isa;
|
Class isa;
|
||||||
}
|
}
|
||||||
+ (void) initialize;
|
|
||||||
- (Class) class;
|
- (Class) class;
|
||||||
- (void) forwardInvocation: (NSInvocation*)anInvocation;
|
- (void) forwardInvocation: (NSInvocation*)anInvocation;
|
||||||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
|
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
|
||||||
|
@ -948,31 +947,58 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
GSSetLocaleC(LC_ALL, ""); // Set up locale from environment.
|
/* Set up locale from environment.
|
||||||
|
* This function should not use any ObjC code since important
|
||||||
|
* classes are not yet initialized.
|
||||||
|
*/
|
||||||
|
GSSetLocaleC(LC_ALL, "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Create the global lock
|
/* Create the global lock.
|
||||||
|
* NB. Ths is one of the first things we do ... setting up a new lock
|
||||||
|
* must not call any other Objective-C classes and must not involve
|
||||||
|
* any use of the autorelease system.
|
||||||
|
*/
|
||||||
gnustep_global_lock = [NSRecursiveLock new];
|
gnustep_global_lock = [NSRecursiveLock new];
|
||||||
|
|
||||||
// Behavior debugging
|
/* Behavior debugging ... enable with environment variable if needed.
|
||||||
|
*/
|
||||||
GSObjCBehaviorDebug(GSPrivateEnvironmentFlag("GNUSTEP_BEHAVIOR_DEBUG",
|
GSObjCBehaviorDebug(GSPrivateEnvironmentFlag("GNUSTEP_BEHAVIOR_DEBUG",
|
||||||
GSObjCBehaviorDebug(-1)));
|
GSObjCBehaviorDebug(-1)));
|
||||||
|
|
||||||
// Zombie management flags.
|
/* Set up the autorelease system ... we must do this before using any
|
||||||
NSZombieEnabled = GSPrivateEnvironmentFlag("NSZombieEnabled", NO);
|
* other class whose +initialize might autorelease something.
|
||||||
NSDeallocateZombies = GSPrivateEnvironmentFlag("NSDeallocateZombies", NO);
|
*/
|
||||||
[NSZombie initialize];
|
|
||||||
|
|
||||||
// Set up the autorelease system
|
|
||||||
autorelease_class = [NSAutoreleasePool class];
|
autorelease_class = [NSAutoreleasePool class];
|
||||||
autorelease_sel = @selector(addObject:);
|
autorelease_sel = @selector(addObject:);
|
||||||
autorelease_imp = [autorelease_class methodForSelector: autorelease_sel];
|
autorelease_imp = [autorelease_class methodForSelector: autorelease_sel];
|
||||||
|
|
||||||
// Make sure the constant string class works.
|
/* Make sure the constant string class works and set up well-known
|
||||||
|
* string constants etc.
|
||||||
|
*/
|
||||||
NSConstantStringClass = [NSString constantStringClass];
|
NSConstantStringClass = [NSString constantStringClass];
|
||||||
GSPrivateBuildStrings();
|
GSPrivateBuildStrings();
|
||||||
|
|
||||||
|
/* Determine zombie management flags and set up a map to store
|
||||||
|
* information about zombie objects.
|
||||||
|
*/
|
||||||
|
NSZombieEnabled = GSPrivateEnvironmentFlag("NSZombieEnabled", NO);
|
||||||
|
NSDeallocateZombies = GSPrivateEnvironmentFlag("NSDeallocateZombies", NO);
|
||||||
|
zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||||
|
NSNonOwnedPointerMapValueCallBacks, 0);
|
||||||
|
|
||||||
|
/* We need to cache the zombie class.
|
||||||
|
* We can't call +class because NSZombie doesn't have that method.
|
||||||
|
* We can't use NSClassFromString() because that would use an NSString
|
||||||
|
* object, and that class hasn't been initialized yet ...
|
||||||
|
*/
|
||||||
|
zombieClass = objc_lookUpClass("NSZombie");
|
||||||
|
|
||||||
|
/* Now that we have a workign autorelease system and working string
|
||||||
|
* classes we are able to set up notifications.
|
||||||
|
*/
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver: self
|
addObserver: self
|
||||||
selector: @selector(_becomeMultiThreaded:)
|
selector: @selector(_becomeMultiThreaded:)
|
||||||
|
@ -2250,15 +2276,6 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
||||||
|
|
||||||
|
|
||||||
@implementation NSZombie
|
@implementation NSZombie
|
||||||
+ (void) initialize
|
|
||||||
{
|
|
||||||
if (nil == zombieClass)
|
|
||||||
{
|
|
||||||
zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
|
||||||
NSNonOwnedPointerMapValueCallBacks, 0);
|
|
||||||
zombieClass = [NSZombie class];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- (Class) class
|
- (Class) class
|
||||||
{
|
{
|
||||||
return (Class)isa;
|
return (Class)isa;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue