osmo_use_count_entry Struct Reference
Use Counter

One named counter in the list managed by osmo_use_count. More...

`#include <use_count.h>`

## Data Fields

struct llist_head | entry
| Entry in osmo_use_count->use_counts. More...
struct osmo_use_count * | use_count
| Parent use count and backpointer to the talloc_object. More...
const char * | use
| Use token string that was passed to osmo_use_count_get_put(). More...
int32_t | count
| Current use count amount for only this use token string. More...

## Detailed Description

One named counter in the list managed by osmo_use_count.

Gets created as necessary by osmo_use_count_get_put(). The total current use count of an object is the sum of all individual osmo_use_count_entry->count.

     object            <--backpointer-+
    t|  .osmo_use_count               |
    a|     .talloc_object ------------+
    l|     .use_counts llist:          use   count
    l|->      - osmo_use_count_entry: "foo"  1
    o|->      - osmo_use_count_entry: "bar"  3
    c|->      - osmo_use_count_entry: "baz"  0  (currently unused entry)

## Field Documentation

## count

int32_t osmo_use_count_entry::count

Current use count amount for only this use token string.

If zero, this entry is currently unused and kept around to avoid frequent de-/allocation.

Referenced by _osmo_use_count_get_put(), osmo_use_count_by(), osmo_use_count_repurpose_zero_entry(), osmo_use_count_to_str_buf(), and osmo_use_count_total().

## entry

struct llist_head osmo_use_count_entry::entry

Entry in osmo_use_count->use_counts.

Referenced by _osmo_use_count_get_put(), osmo_use_count_create(), osmo_use_count_find(), osmo_use_count_free(), osmo_use_count_make_static_entries(), osmo_use_count_repurpose_zero_entry(), osmo_use_count_to_str_buf(), and osmo_use_count_total().

## use

const char* osmo_use_count_entry::use

Use token string that was passed to osmo_use_count_get_put().

Referenced by _osmo_use_count_get_put(), osmo_use_count_by(), osmo_use_count_create(), osmo_use_count_find(), osmo_use_count_repurpose_zero_entry(), and osmo_use_count_to_str_buf().

## use_count

struct osmo_use_count* osmo_use_count_entry::use_count

Parent use count and backpointer to the talloc_object.

Referenced by osmo_use_count_create(), and osmo_use_count_make_static_entries().

The documentation for this struct was generated from the following file:

- include/osmocom/core/use_count.h