globus_memory(3)
π globus_memory β the manual page, bestie edition π
okay so this is globus_memory(3), straight out of the Library Functions Manual, and it's literally about a Memory Pool. yeah. a pool. for memories. well β for memory. let's go π«Ά
β¨ NAME β¨
globus_memory β Memory Pool
- Memory Pool.
(that's it. that's the name. short, sweet, iconic π)
πΈ SYNOPSIS πΈ
Functions
globus_bool_t globus_memory_init (globus_memory_t *mem_info, int node_size, int node_count)β Initialize memory pool.void * globus_memory_pop_node (globus_memory_t *mem_info)β Retrieve a memory item from a pool.globus_bool_t globus_memory_push_node (globus_memory_t *mem_info, void *buffer)β Return a memory item to the pool.globus_bool_t globus_memory_destroy (globus_memory_t *mem_info)β Destroy a memory pool.
π¦ Detailed Description π¦
Memory Pool.
The globus_memory abstraction implements a memory management pool for groups of same-sized data items. π
like, imagine a little VIP lounge where every single guest is the exact same size. no chaos, no drama, just vibes and identical chunks. that's the whole concept, fr fr β¨
π Function Documentation π
globus_bool_t globus_memory_destroy (globus_memory_t * mem_info)
Destroy a memory pool. Free all the memory associated with the memory management structure. For every call to globus_memory_init() there should be a call to globus_memory_destroy() or else memory will leak. π
bestie. BESTIE. do not forget theglobus_memory_destroy(). everyglobus_memory_init()needs its matching destroy, or your memory justβ¦ leaks. forever. haunting you. the leak is the villain of this story π
globus_bool_t globus_memory_init (globus_memory_t * mem_info, int node_size, int node_count)
Initialize memory pool. Initialize the globus memory management structure. π
Before using any functions associate with a memory structure this function must be called. β
Parameters
mem_infoβ The memory management datatypenode_sizeβ The size of the memory to allocated with each pop.node_countβ The initial number of nodes allocated with the memory management structure. If it is exceeded more will be allocated.
so yeah, node_count is giving "starting amount" energy, not "limit" energy β if you blow past it, more nodes just get allocated. no cap. the pool grows π
void * globus_memory_pop_node (globus_memory_t * mem_info)
Retrieve a memory item from a pool. Pop a chunk of memory out of the memory management structure. Similar to malloc(). When no longer using this item, return it to the pool via globus_memory_push_node(). π
it's giving malloc() but make it a whole pool system. take a chunk, use it, then give it back β the circle of life, honestly π§
globus_bool_t globus_memory_push_node (globus_memory_t * mem_info, void * buffer)
Return a memory item to the pool. Push a chunk of memory back into the memory management structure. Similar to free(). π
yeah bestie, this is the free()-coded part. put the chunk back where you found it, the pool is counting on you π«Ά
π Author π
Generated automatically by Doxygen for globus_common from the source code.
okay that's the whole page, and fr fr you ate it π
one last cute lil sign-off: this whole thing is globus_common, Version 18.15, and the page is globus_memory(3) β mwah, go forth and manage your pools responsibly β¨ππ¦
π¦ where this page comes from
- epel 10: globus-common-doc 18.15-1.el10_2 Β· Apache-2.0
- fedora 43: globus-common-doc 18.15-1.fc43 Β· Apache-2.0
- fedora 44: globus-common-doc 18.15-2.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-common-doc 18.15-1 Β· Apache-2.0
- ubuntu stonking: libglobus-common-doc 18.15-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms