mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
Remove/update confusing comments. Separate acquire and assign operations for pointer functions.
This commit is contained in:
parent
f6b8c83bd0
commit
c435c6d7d6
4 changed files with 37 additions and 47 deletions
|
@ -139,23 +139,17 @@ static inline void pointerFunctionsAssign(PFInfo *PF, void **addr, void *value)
|
|||
}
|
||||
}
|
||||
|
||||
/* Acquire the pointer value to store for the specified item.
|
||||
*/
|
||||
static inline void *
|
||||
pointerFunctionsAcquire(PFInfo *PF, void **dst, void *src)
|
||||
pointerFunctionsAcquire(PFInfo *PF, void *src)
|
||||
{
|
||||
if (PF->acquireFunction != 0)
|
||||
src = (*PF->acquireFunction)(src, PF->sizeFunction,
|
||||
PF->options & NSPointerFunctionsCopyIn ? YES : NO);
|
||||
// FIXME: This shouldn't be here. Acquire and assign are separate
|
||||
// operations. Acquire is for copy-in operations (i.e. retain / copy),
|
||||
// assign is for move operations of already-owned pointers. Combining them
|
||||
// like this is Just Plain Wrong™
|
||||
pointerFunctionsAssign(PF, dst, src);
|
||||
{
|
||||
src = (*PF->acquireFunction)(src, PF->sizeFunction,
|
||||
PF->options & NSPointerFunctionsCopyIn ? YES : NO);
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Moves a pointer from location to another.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue