# SbStorage Class Reference
[Portable thread-handling abstractions]

`#include <Inventor/threads/SbStorage.h>`

List of all members.

## Detailed Description

The SbStorage class manages thread-local memory.

This class manages thread-local memory. When different threads access the memory an SbStorage object manages, they will receive different memory blocks back.

This provides a mechanism for sharing read/write static data.

## Public Member Functions

| SbStorage (unsigned int size)
| SbStorage (unsigned int size, void(*constr)(void *), void(*destr)(void *))
| ~SbStorage (void)
void * | get (void)
void | applyToAll (SbStorageApplyFunc *func, void *closure)

## Constructor & Destructor Documentation

SbStorage::SbStorage | ( | unsigned int | size | ) | `[inline]`

| Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object.

SbStorage::SbStorage | ( | unsigned int | size,
|  | void(* | constr)(void *),
|  | void(* | destr)(void *)
| ) | `[inline]`

| Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object. A constructor and a destructor functions can be given that will be called when the actual memory blocks are allocated and freed.

SbStorage::~SbStorage | ( | void |  | ) | `[inline]`

| The destructor.

## Member Function Documentation

void * SbStorage::get | ( | void |  | ) | `[inline]`

| This method returns the calling thread's thread-local memory block.

void SbStorage::applyToAll | ( | SbStorageApplyFunc * | func,
|  | void * | closure
| ) | `[inline]`

| This method will call func for all thread local storage data. closure will be supplied as the second parameter to the callback.

The documentation for this class was generated from the following files:

- SbStorage.h
- storage.c