mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
zeroing weak memory is now treated as weak memory since GC has been dropped
This commit is contained in:
parent
d2fec6b222
commit
5699959d39
1 changed files with 17 additions and 4 deletions
|
@ -186,13 +186,24 @@ relinquishRetainedMemory(const void *item,
|
||||||
DESTROY(self);\
|
DESTROY(self);\
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
||||||
|
{
|
||||||
|
/* Garbage Collection is no longer supported, so we treat all weak
|
||||||
|
* memory the same way.
|
||||||
|
*/
|
||||||
|
_x.options = (options & 0xffffff00) | NSPointerFunctionsWeakMemory;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_x.options = options;
|
_x.options = options;
|
||||||
|
}
|
||||||
|
|
||||||
/* First we look at the memory management options to see which function
|
/* First we look at the memory management options to see which function
|
||||||
* should be used to relinquish contents of a container with these
|
* should be used to relinquish contents of a container with these
|
||||||
* options.
|
* options.
|
||||||
*/
|
*/
|
||||||
if (memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
if (memoryType(options, NSPointerFunctionsWeakMemory)
|
||||||
|
|| memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
||||||
{
|
{
|
||||||
_x.relinquishFunction = 0;
|
_x.relinquishFunction = 0;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +245,8 @@ relinquishRetainedMemory(const void *item,
|
||||||
}
|
}
|
||||||
else if (personalityType(options, NSPointerFunctionsObjectPointerPersonality))
|
else if (personalityType(options, NSPointerFunctionsObjectPointerPersonality))
|
||||||
{
|
{
|
||||||
if (memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
if (memoryType(options, NSPointerFunctionsWeakMemory)
|
||||||
|
|| memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
||||||
{
|
{
|
||||||
_x.acquireFunction = 0;
|
_x.acquireFunction = 0;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +296,8 @@ relinquishRetainedMemory(const void *item,
|
||||||
}
|
}
|
||||||
else /* objects */
|
else /* objects */
|
||||||
{
|
{
|
||||||
if (memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
if (memoryType(options, NSPointerFunctionsWeakMemory)
|
||||||
|
|| memoryType(options, NSPointerFunctionsZeroingWeakMemory))
|
||||||
{
|
{
|
||||||
_x.acquireFunction = 0;
|
_x.acquireFunction = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue