Shared Persistent Heap Data Environment Manual  1.1.0
Macros | Typedefs | Functions
sassimplespace.h File Reference

Shared Address Space Simple Space. Allocate a SAS block as one contiguous space. More...

#include "sastype.h"

Go to the source code of this file.

Macros

#define __C__
 ignore this macro behind the curtain
 

Typedefs

typedef void * SASSimpleSpace_t
 Handle to SAS Simple Space. More...
 

Functions

__C__ SASSimpleSpace_t SASSimpleSpaceInit (void *heap_block, block_size_t block_size, block_size_t space_size)
 Initialize a shared storage block as a simple space. More...
 
__C__ SASSimpleSpace_t SASSimpleSpaceCreate (block_size_t space_size)
 Allocate a SAS block large enough to contain the requested SAS Simple Space. More...
 
__C__ void * SASSimpleSpaceToAddr (SASSimpleSpace_t space)
 Obtain the starting byte address of the simple space within the SASSimpleSpace_t block. More...
 
__C__ SASSimpleSpace_t SASSimpleSpaceFromAddr (void *space)
 Obtain the SASSimpleSpace_t handle from a contained space address. More...
 
__C__ int SASSimpleSpaceDestroy (SASSimpleSpace_t space)
 Destroy a SASSimpleSpace_t and free the shared storage block. More...
 
__C__ block_size_t SASSimpleSpaceFreeSpace (SASSimpleSpace_t space)
 Return the block free space not occupied by control blocks and the simple space. More...
 
__C__ int SASSimpleSpaceDestroyNoLock (SASSimpleSpace_t space)
 Destroy a SASSimpleSpace_t and free the shared storage block. More...
 

Detailed Description

Shared Address Space Simple Space. Allocate a SAS block as one contiguous space.

!

Typedef Documentation

typedef void* SASSimpleSpace_t

Handle to SAS Simple Space.

The type is SAS_RUNTIME_SIMPLESPACE

Function Documentation

__C__ SASSimpleSpace_t SASSimpleSpaceCreate ( block_size_t  space_size)

Allocate a SAS block large enough to contain the requested SAS Simple Space.

Initialize the control blocks within the specified storage block as a Simple Space. The storage block must be power of two in size. The type should be SAS_RUNTIME_SIMPLESPACE.

Parameters
space_sizesize of the simple space within the block.
Returns
a handle to the created SASSimpleSpace_t.
__C__ int SASSimpleSpaceDestroy ( SASSimpleSpace_t  space)

Destroy a SASSimpleSpace_t and free the shared storage block.

The sas_type_t must be SAS_RUNTIME_SIMPLESPACE. Destroy holds an exclusive write while clearing the control blocks and freeing the SAS block.

Parameters
spacehandle of the SASSimpleSpace_t to be destroyed.
Returns
a 0 value indicates success, otherwise failure.
__C__ int SASSimpleSpaceDestroyNoLock ( SASSimpleSpace_t  space)

Destroy a SASSimpleSpace_t and free the shared storage block.

The sas_type_t must be SAS_RUNTIME_SIMPLESPACE.

Parameters
spacehandle of the SASSimpleSpace_t to be destroyed.
Returns
a 0 value indicates success, otherwise failure.
__C__ block_size_t SASSimpleSpaceFreeSpace ( SASSimpleSpace_t  space)

Return the block free space not occupied by control blocks and the simple space.

Parameters
spaceHandle of a SAS Simple Space.
Returns
the size of the remaining free space.
__C__ SASSimpleSpace_t SASSimpleSpaceFromAddr ( void *  space)

Obtain the SASSimpleSpace_t handle from a contained space address.

Find the associated SASSimpleSpace_t control block and return its address as a SASSimpleSpace_t handle.

Parameters
spaceAddress within the range of the contained simple space.
Returns
a handle to the created SASSimpleSpace_t.
__C__ SASSimpleSpace_t SASSimpleSpaceInit ( void *  heap_block,
block_size_t  block_size,
block_size_t  space_size 
)

Initialize a shared storage block as a simple space.

Initialize the control blocks within the specified storage block as a Simple Space. The storage block must be power of two in size and have the same power of two (or better) alignment. The type should be SAS_RUNTIME_SIMPLESPACE.

Parameters
heap_blocka block of allocated SAS storage.
block_sizepower of two size of the heap to be initialized.
space_sizesize of the simple space within the block.
Returns
a handle to the initialized SASSimpleSpace_t
__C__ void* SASSimpleSpaceToAddr ( SASSimpleSpace_t  space)

Obtain the starting byte address of the simple space within the SASSimpleSpace_t block.

Each SASSimpleSpace_t starts with a control block. The Simple Space data starts after this control block.

Parameters
spaceHandle of a SAS Simple Space.
Returns
address of contained simple space data.