mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tiny optimisation - made NSAllocateObject() and NSDeallocateObject() inline.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3203 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2eebaad9ba
commit
c3446cfd4c
1 changed files with 8 additions and 4 deletions
|
@ -247,7 +247,8 @@ fastZone(NSObject *object)
|
|||
|
||||
#endif /* defined(CACHE_ZONE) */
|
||||
|
||||
NSObject *NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
||||
inline NSObject *
|
||||
NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
||||
{
|
||||
id new = nil;
|
||||
int size = aClass->instance_size + extraBytes + sizeof(struct obj_layout);
|
||||
|
@ -272,7 +273,8 @@ NSObject *NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
|||
return new;
|
||||
}
|
||||
|
||||
void NSDeallocateObject(NSObject *anObject)
|
||||
inline void
|
||||
NSDeallocateObject(NSObject *anObject)
|
||||
{
|
||||
if ((anObject!=nil) && CLS_ISCLASS(((id)anObject)->class_pointer))
|
||||
{
|
||||
|
@ -298,7 +300,8 @@ fastZone(NSObject *object)
|
|||
return NSZoneFromPointer(object);
|
||||
}
|
||||
|
||||
NSObject *NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
||||
inline NSObject *
|
||||
NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
||||
{
|
||||
id new = nil;
|
||||
int size = aClass->instance_size + extraBytes;
|
||||
|
@ -315,7 +318,8 @@ NSObject *NSAllocateObject (Class aClass, unsigned extraBytes, NSZone *zone)
|
|||
return new;
|
||||
}
|
||||
|
||||
void NSDeallocateObject(NSObject *anObject)
|
||||
inline void
|
||||
NSDeallocateObject(NSObject *anObject)
|
||||
{
|
||||
if ((anObject!=nil) && CLS_ISCLASS(((id)anObject)->class_pointer))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue