mirror of
https://github.com/gnustep/libs-performance.git
synced 2025-02-21 02:41:01 +00:00
Links from a link store should be considered owned by that store.
This commit is contained in:
parent
5cc01b1ef4
commit
823a8ca6bf
1 changed files with 11 additions and 3 deletions
|
@ -387,14 +387,22 @@ GSLinkedListRemove(GSListLink *link, GSLinkedList *list);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/** Returns a link to the free list of the store. The link must either have
|
||||||
|
* been provided by GSLinkStoreProvideLink() or have been removed from the
|
||||||
|
* store list using GSLinkRemove().
|
||||||
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
GSLinkStoreConsumeLink(GSLinkStore *list, GSListLink NS_CONSUMED *link)
|
GSLinkStoreConsumeLink(GSLinkStore *list, GSListLink *link)
|
||||||
{
|
{
|
||||||
link->next = list->free;
|
link->next = list->free;
|
||||||
list->free = link;
|
list->free = link;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline GSListLink* NS_RETURNS_RETAINED
|
/** Fetches a link from the free list of the store (allocating if necessary).
|
||||||
|
* The link is still nominally owned by the store and must be inserted into
|
||||||
|
* the list or returned to the free list.
|
||||||
|
*/
|
||||||
|
static inline GSListLink*
|
||||||
GSLinkStoreProvideLink(GSLinkStore *list)
|
GSLinkStoreProvideLink(GSLinkStore *list)
|
||||||
{
|
{
|
||||||
GSListLink *link = list->free;
|
GSListLink *link = list->free;
|
||||||
|
|
Loading…
Reference in a new issue