mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Better libFoundation compatibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6869 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0bd8528d2a
commit
26fb99a659
1 changed files with 28 additions and 7 deletions
|
@ -399,10 +399,14 @@ NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone)
|
||||||
new = NSZoneMalloc(zone, size);
|
new = NSZoneMalloc(zone, size);
|
||||||
NSLog(@"No garbage collection information for '%s'", aClass->name);
|
NSLog(@"No garbage collection information for '%s'", aClass->name);
|
||||||
}
|
}
|
||||||
else
|
else if ([aClass requiresTypedMemory])
|
||||||
{
|
{
|
||||||
new = GC_CALLOC_EXPLICTLY_TYPED(1, size, gc_type);
|
new = GC_CALLOC_EXPLICTLY_TYPED(1, size, gc_type);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new = NSZoneMalloc(zone, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new != nil)
|
if (new != nil)
|
||||||
|
@ -591,6 +595,13 @@ static BOOL double_release_check_enabled = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GS_WITH_GC
|
||||||
|
+ (BOOL) requiresTypedMemory
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
if (self == [NSObject class])
|
if (self == [NSObject class])
|
||||||
|
@ -770,12 +781,22 @@ static BOOL deallocNotifications = NO;
|
||||||
|
|
||||||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
struct objc_method* mth =
|
const char *types = aSelector->sel_types;
|
||||||
(object_is_instance(self) ?
|
|
||||||
class_get_instance_method(self->isa, aSelector)
|
if (types == 0)
|
||||||
: class_get_class_method(self->isa, aSelector));
|
{
|
||||||
return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types]
|
struct objc_method *mth;
|
||||||
: nil;
|
|
||||||
|
mth = (object_is_instance(self)
|
||||||
|
? class_get_instance_method(self->isa, aSelector)
|
||||||
|
: class_get_class_method(self->isa, aSelector));
|
||||||
|
if (mth == 0)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
types = mth->method_types;
|
||||||
|
}
|
||||||
|
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) description
|
- (NSString*) description
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue