libosmocore 1.9.0.196-9975
Osmocom core library
osmo_use_count_entry Struct Reference

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_countuse_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

◆ use

◆ 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: