mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
initial implementation of NSPointerArray
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27866 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5ff1f5d2ca
commit
fd763be6a6
3 changed files with 258 additions and 44 deletions
|
@ -131,3 +131,21 @@ pointerFunctionsRelinquish(PFInfo *PF, void **itemptr)
|
|||
*itemptr = 0;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
pointerFunctionsReplace(PFInfo *PF, void **dst, void *src)
|
||||
{
|
||||
if (src != *dst)
|
||||
{
|
||||
if (PF->acquireFunction != 0)
|
||||
src = (*PF->acquireFunction)(src, PF->sizeFunction, PF->shouldCopyIn);
|
||||
if (PF->relinquishFunction != 0)
|
||||
(*PF->relinquishFunction)(*dst, PF->sizeFunction);
|
||||
#if GSWITHGC
|
||||
if (PF->usesWeakReadAndWriteBarriers)
|
||||
GSAssignZeroingWeakPointer(dst, src);
|
||||
else
|
||||
#endif
|
||||
*dst = src;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue