libcomps: /build/libcomps/src/libcomps-0.1.19/libcomps/src/comps_mm.h File Reference

libcomps ..

Data Structures | Functions
comps_mm.h File Reference

COMPS memory management(reference counter) file. More...

`#include <stdlib.h>`
`#include <string.h>`
`#include <signal.h>`

Go to the source code of this file.

## Data Structures
struct | COMPS_RefC

## Functions
COMPS_RefC * | comps_refc_create (void *obj, void(*destructor)(void *))
void | comps_refc_destroy (COMPS_RefC *refc)
void | comps_refc_destroy_v (void *refc)
void | comps_refc_decref (COMPS_RefC *refc)
void | comps_refc_incref (COMPS_RefC *refc)

## Detailed Description

COMPS memory management(reference counter) file.

Details.

## Function Documentation

## ◆ comps_refc_create()

COMPS_RefC * comps_refc_create | ( | void * | obj,
|  | void(*)(void *) | destructor
| ) |  |

reference counter constructor

## ◆ comps_refc_decref()

void comps_refc_decref | ( | COMPS_RefC * | refc | ) |
| inline

alias for comps_refc_destroy

See also
  comps_refc_destroy

## ◆ comps_refc_destroy()

void comps_refc_destroy | ( | COMPS_RefC * | refc | ) |

if ref counter equals zero destroy holded object and ref counter object itself, otherwise decrement counter

See also
  comps_refc_decref

## ◆ comps_refc_destroy_v()

void comps_refc_destroy_v | ( | void * | refc | ) |
| inline

alias with void argument

See also
  comps_refc_destroy

## ◆ comps_refc_incref()

void comps_refc_incref | ( | COMPS_RefC * | refc | ) |
| inline

increment reference counter by 1