---
name: "globus_memory"
section: "3"
platform: "linux"
package: "libglobus-common-doc"
version: "18.14-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_memory"
---

# globus\_memory(3)

Memory Pool - Memory Pool.

## NAME

globus\_memory - Memory Pool

 \- Memory Pool.

## 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.

## 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.

### 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 datatype\
 *node\_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.

### 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()**.

### 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().

## Author

Generated automatically by Doxygen for globus\_common from the source code.
