AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
alloc.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 
4 #ifndef INCLUDED_RTL_ALLOC_H
5 #define INCLUDED_RTL_ALLOC_H
6 
7 #include "sal/config.h"
8 
9 #include "sal/saldllapi.h"
10 #include "sal/types.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 
25 SAL_DLLPUBLIC void * SAL_CALL rtl_allocateMemory (
26  sal_Size Bytes
28 
29 
44 SAL_DLLPUBLIC void * SAL_CALL rtl_reallocateMemory (
45  void * Ptr,
46  sal_Size Bytes
48 
49 
56 SAL_DLLPUBLIC void SAL_CALL rtl_freeMemory (
57  void * Ptr
59 
68 SAL_DLLPUBLIC void * SAL_CALL rtl_allocateZeroMemory (
69  sal_Size Bytes
71 
81 SAL_DLLPUBLIC void SAL_CALL rtl_secureZeroMemory (
82  void * Ptr,
83  sal_Size Bytes
85 
86 
95 SAL_DLLPUBLIC void SAL_CALL rtl_freeZeroMemory (
96  void * Ptr,
97  sal_Size Bytes
99 
116  sal_Size Alignment,
117  sal_Size Bytes
119 
120 
129 SAL_DLLPUBLIC void SAL_CALL rtl_freeAlignedMemory (
130  void * Ptr
132 
133 
136 typedef struct SAL_DLLPUBLIC_RTTI rtl_arena_st rtl_arena_type;
137 
138 #define RTL_ARENA_NAME_LENGTH 31
139 
140 
155  const char * pName,
156  sal_Size quantum,
157  sal_Size quantum_cache_max,
158  rtl_arena_type * source_arena,
159  void * (SAL_CALL * source_alloc)(rtl_arena_type *, sal_Size *),
160  void (SAL_CALL * source_free) (rtl_arena_type *, void *, sal_Size),
161  int nFlags
163 
164 
170 SAL_DLLPUBLIC void SAL_CALL rtl_arena_destroy (
171  rtl_arena_type * pArena
173 
174 
183 SAL_DLLPUBLIC void * SAL_CALL rtl_arena_alloc (
184  rtl_arena_type * pArena,
185  sal_Size * pBytes
187 
188 
196 SAL_DLLPUBLIC void SAL_CALL rtl_arena_free (
197  rtl_arena_type * pArena,
198  void * pAddr,
199  sal_Size nBytes
201 
202 
205 typedef struct rtl_cache_st rtl_cache_type;
206 
207 #define RTL_CACHE_NAME_LENGTH 31
208 
209 #define RTL_CACHE_FLAG_BULKDESTROY 1 /* obsolete */
210 
227  const char * pName,
228  sal_Size nObjSize,
229  sal_Size nObjAlign,
230  int (SAL_CALL * constructor)(void * pObj, void * pUserArg),
231  void (SAL_CALL * destructor) (void * pObj, void * pUserArg),
232  void (SAL_CALL * reclaim) (void * pUserArg),
233  void * pUserArg,
234  rtl_arena_type * pSource,
235  int nFlags
237 
238 
244 SAL_DLLPUBLIC void SAL_CALL rtl_cache_destroy (
245  rtl_cache_type * pCache
247 
248 
254 SAL_DLLPUBLIC void * SAL_CALL rtl_cache_alloc (
255  rtl_cache_type * pCache
257 
258 
265 SAL_DLLPUBLIC void SAL_CALL rtl_cache_free (
266  rtl_cache_type * pCache,
267  void * pObj
269 
270 
271 #ifdef LIBO_INTERNAL_ONLY
272 
301 SAL_DLLPUBLIC void SAL_CALL rtl_alloc_preInit (
302  sal_Bool start
306 #endif
307 
308 #ifdef __cplusplus
309 }
310 #endif
311 
312 #endif // INCLUDED_RTL_ALLOC_H
313 
314 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC void rtl_arena_free(rtl_arena_type *pArena, void *pAddr, sal_Size nBytes) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void rtl_freeZeroMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Zero and free memory.
unsigned char sal_Bool
Definition: types.h:18
SAL_DLLPUBLIC void rtl_secureZeroMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Zero memory.
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
SAL_DLLPUBLIC void * rtl_allocateAlignedMemory(sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate aligned memory.
SAL_DLLPUBLIC void rtl_freeAlignedMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory allocated with rtl_allocateAlignedMemory().
SAL_DLLPUBLIC void * rtl_arena_alloc(rtl_arena_type *pArena, sal_Size *pBytes) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void * rtl_allocateZeroMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate and zero memory.
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
SAL_DLLPUBLIC void rtl_cache_destroy(rtl_cache_type *pCache) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void rtl_arena_destroy(rtl_arena_type *pArena) SAL_THROW_EXTERN_C()
struct rtl_cache_st rtl_cache_type
Opaque rtl_cache_type.
Definition: alloc.h:205
SAL_DLLPUBLIC void * rtl_reallocateMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Reallocate memory.
SAL_DLLPUBLIC rtl_cache_type * rtl_cache_create(const char *pName, sal_Size nObjSize, sal_Size nObjAlign, int(*constructor)(void *pObj, void *pUserArg), void(*destructor)(void *pObj, void *pUserArg), void(*reclaim)(void *pUserArg), void *pUserArg, rtl_arena_type *pSource, int nFlags) SAL_THROW_EXTERN_C()
struct SAL_DLLPUBLIC_RTTI rtl_arena_st rtl_arena_type
Opaque rtl_arena_type.
Definition: alloc.h:136
SAL_DLLPUBLIC rtl_arena_type * rtl_arena_create(const char *pName, sal_Size quantum, sal_Size quantum_cache_max, rtl_arena_type *source_arena, void *(*source_alloc)(rtl_arena_type *, sal_Size *), void(*source_free)(rtl_arena_type *, void *, sal_Size), int nFlags) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
SAL_DLLPUBLIC void * rtl_cache_alloc(rtl_cache_type *pCache) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void rtl_cache_free(rtl_cache_type *pCache, void *pObj) SAL_THROW_EXTERN_C()
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14