sassimpleheap.h
Go to the documentation of this file.
/*
* Copyright (c) 2003-2014 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation, Steven Munroe - initial API and implementation
* IBM Corporation, Adhemerval Zanella - documentation
*/
#ifndef __SAS_SIMPLE_HEAP_H
#define __SAS_SIMPLE_HEAP_H
#include "sastype.h"
typedef void *SASSimpleHeap_t;
#ifdef __cplusplus
#define __C__ "C"
#else
#define __C__
#endif
extern __C__ SASSimpleHeap_t
SASSimpleHeapInit (void *heap_block , sas_type_t sasType,
block_size_t heap_size);
extern __C__ SASSimpleHeap_t
SASSimpleHeapCreate (block_size_t heap_size);
extern __C__ int
SASSimpleHeapDestroy (SASSimpleHeap_t heap);
extern __C__ block_size_t
SASSimpleHeapFreeSpace (SASSimpleHeap_t heap);
extern __C__ int
SASSimpleHeapEmpty (SASSimpleHeap_t heap);
extern __C__ void *
SASSimpleHeapAlloc (SASSimpleHeap_t heap, block_size_t alloc_size);
extern __C__ int
SASSimpleHeapFree (SASSimpleHeap_t heap,
void *free_block,
block_size_t alloc_size);
extern __C__ SASSimpleHeap_t
SASSimpleHeapNearFind(void *nearObj);
extern __C__ void*
SASSimpleHeapNearAlloc(void *nearObj, long allocSize);
extern __C__ void
SASSimpleHeapNearDealloc(void *memAddr, long allocSize);
extern __C__ int
SASSimpleHeapDestroyNoLock (SASSimpleHeap_t heap);
extern __C__ block_size_t
SASSimpleHeapFreeSpaceNoLock (SASSimpleHeap_t heap);
extern __C__ void *
SASSimpleHeapAllocNoLock (SASSimpleHeap_t heap,
block_size_t alloc_size);
extern __C__ int
SASSimpleHeapFreeNoLock (SASSimpleHeap_t heap,
void *free_block,
block_size_t alloc_size);
extern __C__ void*
SASSimpleHeapNearAllocNoLock(void *nearObj, long allocSize);
extern __C__ void
SASSimpleHeapNearDeallocNoLock(void *memAddr, long allocSize);
extern __C__ int
SASSimpleHeapEmptyNoLock (SASSimpleHeap_t heap);
#endif /* __SAS_SIMPLE_HEAP_H */
__C__
#define __C__
ignore this macro behind the curtain
Definition: sasmsync.h:32
SASSimpleHeapInit
__C__ SASSimpleHeap_t SASSimpleHeapInit(void *heap_block, sas_type_t sasType, block_size_t heap_size)
Initialize a shared storage as a simple heap.
SASSimpleHeapDestroyNoLock
__C__ int SASSimpleHeapDestroyNoLock(SASSimpleHeap_t heap)
Destroy a SASSimpleHeap_t and free the shared storage block.
SASSimpleHeapDestroy
__C__ int SASSimpleHeapDestroy(SASSimpleHeap_t heap)
Destroy a SASSimpleHeap_t and free the shared storage block.
SASSimpleHeapNearAlloc
__C__ void * SASSimpleHeapNearAlloc(void *nearObj, long allocSize)
Allocate a block of alloc_size bytes from Simple Heap nearObj.
SASSimpleHeapFree
__C__ int SASSimpleHeapFree(SASSimpleHeap_t heap, void *free_block, block_size_t alloc_size)
Deallocate the memory block free_block of size alloc_size from Simple Heap heap.
SASSimpleHeap_t
void * SASSimpleHeap_t
Handle to SAS Simple Space. The type is SAS_RUNTIME_SIMPLEHEAP.
Definition: sassimpleheap.h:34
SASSimpleHeapNearFind
__C__ SASSimpleHeap_t SASSimpleHeapNearFind(void *nearObj)
Find the associate SASSimpleHeap_t control block near nearObj.
SASSimpleHeapEmptyNoLock
__C__ int SASSimpleHeapEmptyNoLock(SASSimpleHeap_t heap)
Return if the Simple Heap heap has not space left.
SASSimpleHeapCreate
__C__ SASSimpleHeap_t SASSimpleHeapCreate(block_size_t heap_size)
Allocate a SAS block large enough to contain the requested SAS Simple Heap.
SASSimpleHeapAlloc
__C__ void * SASSimpleHeapAlloc(SASSimpleHeap_t heap, block_size_t alloc_size)
Allocate a block of alloc_size bytes from Simple Heap heap.
SASSimpleHeapAllocNoLock
__C__ void * SASSimpleHeapAllocNoLock(SASSimpleHeap_t heap, block_size_t alloc_size)
Allocate a block of alloc_size bytes from Simple Heap heap.
SASSimpleHeapFreeNoLock
__C__ int SASSimpleHeapFreeNoLock(SASSimpleHeap_t heap, void *free_block, block_size_t alloc_size)
Deallocate the memory block free_block of size alloc_size from Simple Heap heap.
SASSimpleHeapNearDealloc
__C__ void SASSimpleHeapNearDealloc(void *memAddr, long allocSize)
Deallocate the memory block memAddr of size allocSize.
SASSimpleHeapFreeSpace
__C__ block_size_t SASSimpleHeapFreeSpace(SASSimpleHeap_t heap)
Return the available space from Simple Heap heap.
SASSimpleHeapFreeSpaceNoLock
__C__ block_size_t SASSimpleHeapFreeSpaceNoLock(SASSimpleHeap_t heap)
Return the available space from Simple Heap heap.
SASSimpleHeapNearAllocNoLock
__C__ void * SASSimpleHeapNearAllocNoLock(void *nearObj, long allocSize)
Allocate a block of allocSize bytes from Simple Heap heap.
SASSimpleHeapNearDeallocNoLock
__C__ void SASSimpleHeapNearDeallocNoLock(void *memAddr, long allocSize)
Deallocate the memory block memAddr of size allocSize.
SASSimpleHeapEmpty
__C__ int SASSimpleHeapEmpty(SASSimpleHeap_t heap)
Return if the Simple Heap heap has no space left.