/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* * This file is part of LibreOffice published API.
*/
A call to this function with parameter 'Ptr' being NULL is equivalent to a rtl_allocateMemory() call. A call to this function with parameter 'Bytes' being 0 is equivalent to a rtl_freeMemory() call.
@see rtl_allocateMemory() @see rtl_freeMemory()
@param[in] Ptr pointer to the previously allocated memory. @param[in] Bytes new memory size. @return pointer to the reallocated memory. May differ from Ptr.
*/
SAL_DLLPUBLIC void * SAL_CALL rtl_reallocateMemory ( void * Ptr,
sal_Size Bytes
) SAL_THROW_EXTERN_C();
/** Free memory.
Memory is released, and the pointer is invalidated.
@param[in] Ptr pointer to the previously allocated memory.
*/
SAL_DLLPUBLIC void SAL_CALL rtl_freeMemory ( void * Ptr
) SAL_THROW_EXTERN_C();
/** Allocate and zero memory.
A call to this function will return NULL upon the requested memory size being either zero or larger than currently allocatable.
@param[in] Bytes memory size. @return pointer to the allocated and zero'ed memory.
*/
SAL_DLLPUBLIC void * SAL_CALL rtl_allocateZeroMemory (
sal_Size Bytes
) SAL_THROW_EXTERN_C();
/** Zero memory
Fills a block of memory with zeros in a way that is guaranteed to be secure
@param[in] Ptr pointer to the previously allocated memory. @param[in] Bytes memory size.
A call to this function will return NULL upon the requested memory size being either zero or larger than currently allocatable.
Memory obtained through this function must be freed with rtl_freeAlignedMemory().
@param[in] Alignment alignment in bytes, must be a power of two multiple of sizeof(void*). @param[in] Bytes memory size. @return pointer to the allocated memory.
/** * @param[in] pName descriptive name; for debugging purposes. * @param[in] quantum resource allocation unit / granularity; rounded up to next power of 2. * @param[in] quantum_cache_max no longer used, should be 0. * @param[in] source_arena passed as argument to source_alloc, source_free; usually NULL. * @param[in] source_alloc function to allocate resources; usually rtl_arena_alloc. * @param[in] source_free function to free resources; usually rtl_arena_free. * @param[in] nFlags flags; usually 0. * * @return pointer to rtl_arena_type, or NULL upon failure. * * @see rtl_arena_destroy()
*/
SAL_DLLPUBLIC rtl_arena_type * SAL_CALL rtl_arena_create ( constchar * pName,
sal_Size quantum,
sal_Size quantum_cache_max,
rtl_arena_type * source_arena, void * (SAL_CALL * source_alloc)(rtl_arena_type *, sal_Size *), void (SAL_CALL * source_free) (rtl_arena_type *, void *, sal_Size), int nFlags
) SAL_THROW_EXTERN_C();
/** * @param[in] pCache cache from which object is allocated. * * @return pointer to the allocated object, or NULL upon failure.
*/
SAL_DLLPUBLIC void * SAL_CALL rtl_cache_alloc (
rtl_cache_type * pCache
) SAL_THROW_EXTERN_C();
/** * @param[in] pCache cache from which object was allocated. * @param[in] pObj object to free. * * @see rtl_cache_alloc()
*/
SAL_DLLPUBLIC void SAL_CALL rtl_cache_free (
rtl_cache_type * pCache, void * pObj
) SAL_THROW_EXTERN_C();
#ifdef LIBO_INTERNAL_ONLY
/** @cond INTERNAL */ /** rtl_alloc_preInit * * This function, is called at the beginning and again * at the end of LibreOfficeKit pre-initialization to enable * various optimizations. * * Its function is to annotate a section @start = true * to end (@start = false) via. two calls. Inside this * section string allocators are replaced with ones which cause the * strings to be staticized at the end of the section. * * This brings a number of constraints - in particular no * string allocated outside the section should be freed * inside it, practically this means starting the section * as early as possible. No string allocated inside the * section will be freed subsequently as they are * staticized. * * This method is not thread-safe, nor intended for use in * a threaded context, cf. previous constraints. * * It is almost certainly not the method that you want, * use with extraordinary care referring to the * implementation. * * @since LibreOffice 6.1
*/
SAL_DLLPUBLIC void SAL_CALL rtl_alloc_preInit (
sal_Bool start
) SAL_THROW_EXTERN_C(); /** @endcond */
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.