mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-24 01:11:01 +00:00
fixup to compile again
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35881 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6965163efb
commit
9923323d24
3 changed files with 17 additions and 12 deletions
|
@ -71,19 +71,18 @@ static Class concreteClass = 0;
|
|||
return AUTORELEASE(t);
|
||||
}
|
||||
|
||||
+ (id) weakObjectsHashTable
|
||||
|
||||
{
|
||||
return [self hashTableWithOptions:
|
||||
NSPointerFunctionsObjectPersonality | NSPointerFunctionsWeakMemory];
|
||||
}
|
||||
|
||||
+ (id) hashTableWithWeakObjects
|
||||
{
|
||||
return [self hashTableWithOptions:
|
||||
NSPointerFunctionsObjectPersonality | NSPointerFunctionsZeroingWeakMemory];
|
||||
}
|
||||
|
||||
+ (id) weakObjectsHashTable
|
||||
{
|
||||
return [self hashTableWithOptions:
|
||||
NSPointerFunctionsObjectPersonality | NSPointerFunctionsWeakMemory];
|
||||
}
|
||||
|
||||
- (id) initWithOptions: (NSPointerFunctionsOptions)options
|
||||
capacity: (NSUInteger)initialCapacity
|
||||
{
|
||||
|
|
|
@ -98,23 +98,27 @@ static Class concreteClass = 0;
|
|||
valueOptions: NSPointerFunctionsObjectPersonality
|
||||
| NSPointerFunctionsZeroingWeakMemory];
|
||||
}
|
||||
|
||||
+ (id) strongToStrongObjectsMapTable
|
||||
{
|
||||
return [self mapTableWithKeyOptions: NSMapTableObjectPointerPersonality
|
||||
valueOptions: NSMapTableObjectPointerPersonality];
|
||||
}
|
||||
|
||||
+ (id) strongToWeakObjectsMapTable
|
||||
{
|
||||
return [self mapTableWithKeyOptions: NSMapTableObjectPointerPersonality
|
||||
valueOptions: NSMapTableObjectPointerPersonality |
|
||||
NSMapTableWeakMemory];
|
||||
}
|
||||
|
||||
+ (id) weakToStrongObjectsMapTable
|
||||
{
|
||||
return [self mapTableWithKeyOptions: NSMapTableObjectPointerPersonality |
|
||||
NSMapTableWeakMemory
|
||||
valueOptions: NSMapTableObjectPointerPersonality];
|
||||
}
|
||||
|
||||
+ (id) weakToWeakObjectsMapTable
|
||||
{
|
||||
return [self mapTableWithKeyOptions: NSMapTableObjectPointerPersonality |
|
||||
|
@ -123,7 +127,6 @@ static Class concreteClass = 0;
|
|||
NSMapTableWeakMemory];
|
||||
}
|
||||
|
||||
|
||||
- (id) initWithKeyOptions: (NSPointerFunctionsOptions)keyOptions
|
||||
valueOptions: (NSPointerFunctionsOptions)valueOptions
|
||||
capacity: (NSUInteger)initialCapacity
|
||||
|
|
|
@ -334,11 +334,14 @@ static Class concreteClass = Nil;
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
int i;
|
||||
|
||||
[self finalize];
|
||||
// For weak memory, we must zero all of the elements, or the runtime will
|
||||
// keep pointers to them lying around. For strong memory, we must release
|
||||
// things or they will leak.
|
||||
for (int i=0 ; i<_count ; i++)
|
||||
/* For weak memory, we must zero all of the elements, or the runtime will
|
||||
* keep pointers to them lying around. For strong memory, we must release
|
||||
* things or they will leak.
|
||||
*/
|
||||
for (i = 0; i < _count; i++)
|
||||
{
|
||||
pointerFunctionsAssign(&_pf, &_contents[i], 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue