LibreOffice: rtl/alloc.h Source File

LibreOffice LibreOffice 25.2 SDK C/C++ API Reference |

Loading...
Searching...
No Matches
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 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_RTL_ALLOC_H
25#define INCLUDED_RTL_ALLOC_H
26
27#include "sal/config.h"
28
29#include "sal/saldllapi.h"
30#include "sal/types.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36
45 SAL_DLLPUBLIC void * SAL_CALL rtl_allocateMemory (
46 sal_Size Bytes
47) SAL_THROW_EXTERN_C();
48
49
64 SAL_DLLPUBLIC void * SAL_CALL rtl_reallocateMemory (
65 void * Ptr,
66 sal_Size Bytes
67) SAL_THROW_EXTERN_C();
68
69
76 SAL_DLLPUBLIC void SAL_CALL rtl_freeMemory (
77 void * Ptr
78) SAL_THROW_EXTERN_C();
79
88 SAL_DLLPUBLIC void * SAL_CALL rtl_allocateZeroMemory (
89 sal_Size Bytes
90) SAL_THROW_EXTERN_C();
91
101 SAL_DLLPUBLIC void SAL_CALL rtl_secureZeroMemory (
102 void * Ptr,
103 sal_Size Bytes
104) SAL_THROW_EXTERN_C();
105
106
115 SAL_DLLPUBLIC void SAL_CALL rtl_freeZeroMemory (
116 void * Ptr,
117 sal_Size Bytes
118) SAL_THROW_EXTERN_C();
119
135 SAL_DLLPUBLIC void* SAL_CALL rtl_allocateAlignedMemory (
136 sal_Size Alignment,
137 sal_Size Bytes
138) SAL_THROW_EXTERN_C();
139
140
149 SAL_DLLPUBLIC void SAL_CALL rtl_freeAlignedMemory (
150 void * Ptr
151) SAL_THROW_EXTERN_C();
152
153
156 struct SAL_DLLPUBLIC_RTTI rtl_arena_st;
157 typedef struct rtl_arena_st rtl_arena_type;
158
159#define RTL_ARENA_NAME_LENGTH 31
160
161
175 SAL_DLLPUBLIC rtl_arena_type * SAL_CALL rtl_arena_create (
176 const char * pName,
177 sal_Size quantum,
178 sal_Size quantum_cache_max,
179 rtl_arena_type * source_arena,
180 void * (SAL_CALL * source_alloc)(rtl_arena_type *, sal_Size *),
181 void (SAL_CALL * source_free) (rtl_arena_type *, void *, sal_Size),
182 int nFlags
183) SAL_THROW_EXTERN_C();
184
185
191 SAL_DLLPUBLIC void SAL_CALL rtl_arena_destroy (
192 rtl_arena_type * pArena
193) SAL_THROW_EXTERN_C();
194
195
204 SAL_DLLPUBLIC void * SAL_CALL rtl_arena_alloc (
205 rtl_arena_type * pArena,
206 sal_Size * pBytes
207) SAL_THROW_EXTERN_C();
208
209
217 SAL_DLLPUBLIC void SAL_CALL rtl_arena_free (
218 rtl_arena_type * pArena,
219 void * pAddr,
220 sal_Size nBytes
221) SAL_THROW_EXTERN_C();
222
223
226 typedef struct rtl_cache_st rtl_cache_type;
227
228#define RTL_CACHE_NAME_LENGTH 31
229
230#define RTL_CACHE_FLAG_BULKDESTROY 1 /* obsolete */
231
247 SAL_DLLPUBLIC rtl_cache_type * SAL_CALL rtl_cache_create (
248 const char * pName,
249 sal_Size nObjSize,
250 sal_Size nObjAlign,
251 int (SAL_CALL * constructor)(void * pObj, void * pUserArg),
252 void (SAL_CALL * destructor) (void * pObj, void * pUserArg),
253 void (SAL_CALL * reclaim) (void * pUserArg),
254 void * pUserArg,
255 rtl_arena_type * pSource,
256 int nFlags
257) SAL_THROW_EXTERN_C();
258
259
265 SAL_DLLPUBLIC void SAL_CALL rtl_cache_destroy (
266 rtl_cache_type * pCache
267) SAL_THROW_EXTERN_C();
268
269
275 SAL_DLLPUBLIC void * SAL_CALL rtl_cache_alloc (
276 rtl_cache_type * pCache
277) SAL_THROW_EXTERN_C();
278
279
286 SAL_DLLPUBLIC void SAL_CALL rtl_cache_free (
287 rtl_cache_type * pCache,
288 void * pObj
289) SAL_THROW_EXTERN_C();
290
291
292#ifdef LIBO_INTERNAL_ONLY
293
322 SAL_DLLPUBLIC void SAL_CALL rtl_alloc_preInit (
323 sal_Bool start
324) SAL_THROW_EXTERN_C();
326
327#endif
328
329#ifdef __cplusplus
330}
331#endif
332
333#endif // INCLUDED_RTL_ALLOC_H
334
335/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
config.h
saldllapi.h
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition saldllapi.h:34
types.h
sal_Bool
unsigned char sal_Bool
Definition types.h:38
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition types.h:352
rtl_freeMemory
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
rtl_arena_free
SAL_DLLPUBLIC void rtl_arena_free(rtl_arena_type *pArena, void *pAddr, sal_Size nBytes) SAL_THROW_EXTERN_C()
rtl_allocateZeroMemory
SAL_DLLPUBLIC void * rtl_allocateZeroMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate and zero memory.
rtl_allocateMemory
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
rtl_cache_destroy
SAL_DLLPUBLIC void rtl_cache_destroy(rtl_cache_type *pCache) SAL_THROW_EXTERN_C()
rtl_freeZeroMemory
SAL_DLLPUBLIC void rtl_freeZeroMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Zero and free memory.
rtl_allocateAlignedMemory
SAL_DLLPUBLIC void * rtl_allocateAlignedMemory(sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate aligned memory.
rtl_arena_alloc
SAL_DLLPUBLIC void * rtl_arena_alloc(rtl_arena_type *pArena, sal_Size *pBytes) SAL_THROW_EXTERN_C()
rtl_cache_free
SAL_DLLPUBLIC void rtl_cache_free(rtl_cache_type *pCache, void *pObj) SAL_THROW_EXTERN_C()
rtl_arena_destroy
SAL_DLLPUBLIC void rtl_arena_destroy(rtl_arena_type *pArena) SAL_THROW_EXTERN_C()
rtl_reallocateMemory
SAL_DLLPUBLIC void * rtl_reallocateMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Reallocate memory.
rtl_cache_type
struct rtl_cache_st rtl_cache_type
Opaque rtl_cache_type.
Definition alloc.h:226
rtl_freeAlignedMemory
SAL_DLLPUBLIC void rtl_freeAlignedMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory allocated with rtl_allocateAlignedMemory().
rtl_arena_type
struct rtl_arena_st rtl_arena_type
Definition alloc.h:157
rtl_cache_alloc
SAL_DLLPUBLIC void * rtl_cache_alloc(rtl_cache_type *pCache) SAL_THROW_EXTERN_C()
rtl_cache_create
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()
rtl_arena_st
struct SAL_DLLPUBLIC_RTTI rtl_arena_st
Opaque rtl_arena_type.
Definition alloc.h:156
rtl_secureZeroMemory
SAL_DLLPUBLIC void rtl_secureZeroMemory(void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C()
Zero memory.
rtl_arena_create
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()