mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
GC tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28063 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8afbc2fcb7
commit
d2e2eda24c
2 changed files with 25 additions and 0 deletions
|
@ -241,7 +241,12 @@ add_to_queue(NSNotificationQueueList *queue, NSNotification *notification,
|
|||
{
|
||||
NSNotificationQueueRegistration *item;
|
||||
|
||||
#if GS_WITH_GC
|
||||
item = NSAllocateCollectable(sizeof(NSNotificationQueueRegistration),
|
||||
NSScannedOption);
|
||||
#else
|
||||
item = NSZoneCalloc(_zone, 1, sizeof(NSNotificationQueueRegistration));
|
||||
#endif
|
||||
if (item == 0)
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
|
@ -334,8 +339,15 @@ add_to_queue(NSNotificationQueueList *queue, NSNotification *notification,
|
|||
|
||||
// init queue
|
||||
_center = RETAIN(notificationCenter);
|
||||
#if GS_WITH_GC
|
||||
_asapQueue = NSAllocateCollectable(sizeof(NSNotificationQueueList),
|
||||
NSScannedOption);
|
||||
_idleQueue = NSAllocateCollectable(sizeof(NSNotificationQueueList),
|
||||
NSScannedOption);
|
||||
#else
|
||||
_asapQueue = NSZoneCalloc(_zone, 1, sizeof(NSNotificationQueueList));
|
||||
_idleQueue = NSZoneCalloc(_zone, 1, sizeof(NSNotificationQueueList));
|
||||
#endif
|
||||
if (_asapQueue == 0 || _idleQueue == 0)
|
||||
{
|
||||
DESTROY(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue