libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_ref.h File Reference

Go to the source code of this file.

Macros

#define GblRef_create(...)
 
#define GblRef_ref(ref)
 
#define GblRef_unref(...)
 
#define GblRef_create__1(size)
 
#define GblRef_create__2(size, ctx)
 
#define GblRef_unref__1(ref)
 
#define GblRef_unref__2(ref, dtor)
 

Typedefs

typedef void GblRef
 
typedef GBL_RESULT(* GblRefDestructFn) (GblRef *pSelf)
 

Functions

GBL_RESULT GblRef_reinit (void)
 
GblRefCount GblRef_activeCount (void)
 
void * GblRef_alloc (size_t size)
 
void * GblRef_allocWithContext (size_t size, GblContext *pCtx)
 
void * GblRef_acquire (const GblRef *pSelf)
 
GblRefCount GblRef_release (const GblRef *pSelf)
 
GblRefCount GblRef_releaseWithDtor (const GblRef *pSelf, GblRefDestructFn pFnDtor)
 
GblRefCount GblRef_refCount (const GblRef *pSelf)
 
GblContextGblRef_context (const GblRef *pSelf)
 

Detailed Description

Generic reference-counted pointers.

This file contains GblRef, an atomic reference-counted shared pointer type, as well as its associated API.

Note
The reference-counting metadata for a GblRef is stored within a header above the returned pointer, meaning that a client can use a GblRef as though it were a regular void* type, other than managing its lifetime.
Author
2023 Falco Girgis

Definition in file gimbal_ref.h.

Macro Definition Documentation

◆ GblRef_create

#define GblRef_create (   ...)

Definition at line 48 of file gimbal_ref.h.

◆ GblRef_ref

#define GblRef_ref (   ref)

Definition at line 49 of file gimbal_ref.h.

◆ GblRef_unref

#define GblRef_unref (   ...)

Definition at line 50 of file gimbal_ref.h.

◆ GblRef_create__1

#define GblRef_create__1 (   size)

Definition at line 52 of file gimbal_ref.h.

◆ GblRef_create__2

#define GblRef_create__2 (   size,
  ctx 
)

Definition at line 53 of file gimbal_ref.h.

◆ GblRef_unref__1

#define GblRef_unref__1 (   ref)

Definition at line 55 of file gimbal_ref.h.

◆ GblRef_unref__2

#define GblRef_unref__2 (   ref,
  dtor 
)

Definition at line 56 of file gimbal_ref.h.

Typedef Documentation

◆ GblRefDestructFn

typedef GBL_RESULT(* GblRefDestructFn) (GblRef *pSelf)

Definition at line 31 of file gimbal_ref.h.