---
name: "ACE_Cached_Mem_Pool_Node"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Cached_Mem_Pool_Node"
---

# ACE\_Cached\_Mem\_Pool\_Node(3)

ACE\_Cached\_Mem\_Pool\_Node keeps unused memory within a free list.

## NAME

ACE\_Cached\_Mem\_Pool\_Node -  ACE\_Cached\_Mem\_Pool\_Node keeps unused memory within a free list.

## SYNOPSIS

```
#include <ace/Malloc_T.h>
template<class T>
class ACE_Cached_Mem_Pool_Node
{
  public:
    T *addr (void);
    ACE_Cached_Mem_Pool_Node<T> *get_next (void);
    void set_next (ACE_Cached_Mem_Pool_Node<T> *ptr);
  private:
    ACE_Cached_Mem_Pool_Node<T> *next_;
};
```

## DESCRIPTION

The length of a piece of unused memory must be greater than sizeof (void\*).  This makes sense because we'll waste even more memory if we keep them in a separate data structure. This class should really be placed within the next class ACE\_Cached\_Allocator.  But this can't be done due to C++ compiler portability problems.

## PUBLIC MEMBERS

```
T *addr (void);
```

return the address of free memory.

```
ACE_Cached_Mem_Pool_Node<T> *get_next (void);
```

get the next ACE\_Cached\_Mem\_Pool\_Node in a list.

```
void set_next (ACE_Cached_Mem_Pool_Node<T> *ptr);
```

set the next ACE\_Cached\_Mem\_Pool\_Node.

## PRIVATE MEMBERS

```
ACE_Cached_Mem_Pool_Node<T> *next_;
```

Since memory is not used when placed in a free list, we can use it to maintain the structure of  free list. I was using union to hide the fact of overlapping memory usage.  However, that cause problem on MSVC.  So, I now turn back to hack this with casting.

## AUTHOR

Doug Schmidt and Irfan Pyarali

## LIBRARY

ace
