Content-type: text/html
Manpage of RTRefCnt_Object
RTRefCnt_Object
Section: Chronolytix (3)
Updated: 2005-07-07
Index
Return to Main Contents
NAME
RTRefCnt_Object - Chronolytix Memory Allocator Class
SYNOPSYS
#include <RTRefCnt_Object.h>
typedef void (*RTRefCnt_Destructor)(void *object);
RTRefCnt_Object *RTRefCnt_Constructor(intsize, RTRefCnt_Destructor destructor);
RTRefCnt_Object *RTRefCnt_Acquire(RTRefCnt_Object *rc_obp);
void RTRefCnt_Release(RTRefCnt_Object **rc_obpp);
DESCRIPTION
RTRefCnt_Object
is the Chronolytix class for allocation/deallocation of reference counted opaque objects. In this the
Constructor
is analogous to
malloc
with the exception that an optional
destructor
may be registered. In addition, a reference count of one is set for each
constructed object.
For each call to
RTRefCnt_Acquire
a reference counter is incremented atomically. Thus, the integrity of the reference counted object is lock-free and race-free.
Each call to
RTRefCnt_Release
will atomically decrement the reference counter and will NULL the caller's reference counted pointer. If the reference counter equals zero (ie., no remaining references), the reference counting object and underlying apparatus after freed using
RTFree.
RTRefCnt_Object is a core Chronolytix function.
MAGIC
RTRefCnt_Object "RCnt"
BUGS
There is no realloc type of resizer.
SEE ALSO
malloc(3),free(3)
RTMalloc(Chronolytix),
RTAtomic(Chronolytix),
Index
- NAME
-
- SYNOPSYS
-
- DESCRIPTION
-
- MAGIC
-
- BUGS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 18:28:40 GMT, August 25, 2005