picotm  0.4.0
Data Structures | Macros
picotm-lib-ref.h File Reference
#include <assert.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
Include dependency graph for picotm-lib-ref.h:

Data Structures

struct  picotm_ref16
 
struct  picotm_shared_ref16
 

Macros

#define picotm_ref_init(self, count)
 
#define picotm_ref_up(self)
 
#define picotm_ref_down(self)
 
#define picotm_ref_count(self)
 

Macro Definition Documentation

◆ picotm_ref_count

#define picotm_ref_count (   self)

Reads a reference counter's value.

Parameters
selfreference counter
Returns
The current value of the reference counter.

◆ picotm_ref_down

#define picotm_ref_down (   self)

Decrements a reference counter.

Parameters
selfA reference counter
Returns
True is this is the final reference, false otherwise.

◆ picotm_ref_init

#define picotm_ref_init (   self,
  count 
)

Initializes a reference counter with the given value.

Parameters
selfA reference counter
countThe initial reference count

◆ picotm_ref_up

#define picotm_ref_up (   self)

Increments a reference counter.

Parameters
selfA reference counter
Returns
True is this is the first reference, false otherwise.