mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
GC changes for MacOS-X compatiblity
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27630 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8a5a8ba8eb
commit
c41bdeb638
20 changed files with 537 additions and 294 deletions
|
@ -147,7 +147,12 @@ static Class GSInlineArrayClass;
|
|||
{
|
||||
unsigned i;
|
||||
|
||||
#if GS_WITH_GC
|
||||
_contents_array = NSAllocateCollectable(sizeof(id)*count,
|
||||
NSScannedOption);
|
||||
#else
|
||||
_contents_array = NSZoneMalloc([self zone], sizeof(id)*count);
|
||||
#endif
|
||||
if (_contents_array == 0)
|
||||
{
|
||||
RELEASE(self);
|
||||
|
@ -204,7 +209,12 @@ static Class GSInlineArrayClass;
|
|||
at: &_count];
|
||||
if (_count > 0)
|
||||
{
|
||||
#if GS_WITH_GC
|
||||
_contents_array = NSAllocateCollectable(sizeof(id) * _count,
|
||||
NSScannedOption);
|
||||
#else
|
||||
_contents_array = NSZoneCalloc([self zone], _count, sizeof(id));
|
||||
#endif
|
||||
if (_contents_array == 0)
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
|
@ -497,7 +507,11 @@ static Class GSInlineArrayClass;
|
|||
{
|
||||
cap = 1;
|
||||
}
|
||||
#if GS_WITH_GC
|
||||
_contents_array = NSAllocateCollectable(sizeof(id)*cap, NSScannedOption);
|
||||
#else
|
||||
_contents_array = NSZoneMalloc([self zone], sizeof(id)*cap);
|
||||
#endif
|
||||
_capacity = cap;
|
||||
_grow_factor = cap > 1 ? cap/2 : 1;
|
||||
return self;
|
||||
|
@ -1074,7 +1088,7 @@ static Class GSInlineArrayClass;
|
|||
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &c];
|
||||
a = (id)NSAllocateObject(GSArrayClass, 0, GSObjCZone(self));
|
||||
a->_contents_array = NSZoneMalloc(GSObjCZone(self), sizeof(id)*c);
|
||||
a->_contents_array = NSAllocateCollectable(sizeof(id)*c, NSScannedOption);
|
||||
#else
|
||||
GSInlineArray *a;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue