Shared Persistent Heap Data Environment Manual  1.1.0
sassimpleheap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2014 IBM Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation, Steven Munroe - initial API and implementation
10  * IBM Corporation, Adhemerval Zanella - documentation
11  */
12 
13 #ifndef __SAS_SIMPLE_HEAP_H
14 #define __SAS_SIMPLE_HEAP_H
15 
16 #include "sastype.h"
17 
34 typedef void *SASSimpleHeap_t;
35 
36 #ifdef __cplusplus
37 #define __C__ "C"
38 #else
39 #define __C__
40 #endif
41 
56 extern __C__ SASSimpleHeap_t
57 SASSimpleHeapInit (void *heap_block , sas_type_t sasType,
58  block_size_t heap_size);
59 
70 extern __C__ SASSimpleHeap_t
71 SASSimpleHeapCreate (block_size_t heap_size);
72 
83 extern __C__ int
85 
95 extern __C__ block_size_t
97 
108 extern __C__ int
110 
122 extern __C__ void *
123 SASSimpleHeapAlloc (SASSimpleHeap_t heap, block_size_t alloc_size);
124 
139 extern __C__ int
141  void *free_block,
142  block_size_t alloc_size);
143 
150 extern __C__ SASSimpleHeap_t
151 SASSimpleHeapNearFind(void *nearObj);
152 
165 extern __C__ void*
166 SASSimpleHeapNearAlloc(void *nearObj, long allocSize);
167 
180 extern __C__ void
181 SASSimpleHeapNearDealloc(void *memAddr, long allocSize);
182 
191 extern __C__ int
193 
202 extern __C__ block_size_t
204 
215 extern __C__ void *
217  block_size_t alloc_size);
218 
232 extern __C__ int
234  void *free_block,
235  block_size_t alloc_size);
236 
247 extern __C__ void*
248 SASSimpleHeapNearAllocNoLock(void *nearObj, long allocSize);
249 
260 extern __C__ void
261 SASSimpleHeapNearDeallocNoLock(void *memAddr, long allocSize);
262 
272 extern __C__ int
274 
275 #endif /* __SAS_SIMPLE_HEAP_H */
__C__ void SASSimpleHeapNearDeallocNoLock(void *memAddr, long allocSize)
Deallocate the memory block memAddr of size allocSize.
__C__ SASSimpleHeap_t SASSimpleHeapCreate(block_size_t heap_size)
Allocate a SAS block large enough to contain the requested SAS Simple Heap.
__C__ SASSimpleHeap_t SASSimpleHeapNearFind(void *nearObj)
Find the associate SASSimpleHeap_t control block near nearObj.
__C__ void * SASSimpleHeapAllocNoLock(SASSimpleHeap_t heap, block_size_t alloc_size)
Allocate a block of alloc_size bytes from Simple Heap heap.
__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.
__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.
__C__ void * SASSimpleHeapAlloc(SASSimpleHeap_t heap, block_size_t alloc_size)
Allocate a block of alloc_size bytes from Simple Heap heap.
#define __C__
ignore this macro behind the curtain
Definition: sasmsync.h:32
__C__ void SASSimpleHeapNearDealloc(void *memAddr, long allocSize)
Deallocate the memory block memAddr of size allocSize.
__C__ void * SASSimpleHeapNearAlloc(void *nearObj, long allocSize)
Allocate a block of alloc_size bytes from Simple Heap nearObj.
__C__ int SASSimpleHeapEmptyNoLock(SASSimpleHeap_t heap)
Return if the Simple Heap heap has not space left.
__C__ int SASSimpleHeapEmpty(SASSimpleHeap_t heap)
Return if the Simple Heap heap has no space left.
void * SASSimpleHeap_t
Handle to SAS Simple Space. The type is SAS_RUNTIME_SIMPLEHEAP.
Definition: sassimpleheap.h:34
__C__ block_size_t SASSimpleHeapFreeSpace(SASSimpleHeap_t heap)
Return the available space from Simple Heap heap.
__C__ SASSimpleHeap_t SASSimpleHeapInit(void *heap_block, sas_type_t sasType, block_size_t heap_size)
Initialize a shared storage as a simple heap.
__C__ int SASSimpleHeapDestroyNoLock(SASSimpleHeap_t heap)
Destroy a SASSimpleHeap_t and free the shared storage block.
__C__ int SASSimpleHeapDestroy(SASSimpleHeap_t heap)
Destroy a SASSimpleHeap_t and free the shared storage block.
__C__ void * SASSimpleHeapNearAllocNoLock(void *nearObj, long allocSize)
Allocate a block of allocSize bytes from Simple Heap heap.
__C__ block_size_t SASSimpleHeapFreeSpaceNoLock(SASSimpleHeap_t heap)
Return the available space from Simple Heap heap.