Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
FixedSizeAllocator.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: FixedSizeAllocator.h 5978 2026-09-11 16:13:48Z wini $
14 *
15 * COPYRIGHT: Real Time Logic LLC, 2005-2008
16 *
17 * This software is copyrighted by and is the sole property of Real
18 * Time Logic LLC. All rights, title, ownership, or other interests in
19 * the software remain the property of Real Time Logic LLC. This
20 * software may only be used in accordance with the terms and
21 * conditions stipulated in the corresponding license agreement under
22 * which the software has been supplied. Any unauthorized use,
23 * duplication, transmission, distribution, or disclosure of this
24 * software is expressly forbidden.
25 *
26 * This Copyright notice may not be removed or modified without prior
27 * written consent of Real Time Logic LLC.
28 *
29 * Real Time Logic LLC. reserves the right to modify this software
30 * without notice.
31 *
32 * http://www.realtimelogic.com
33 ****************************************************************************
34 *
35 */
36
39#ifndef __FixedSizeAllocator_h
40#define __FixedSizeAllocator_h
41
42#include <BaServerLib.h>
43#include <SingleList.h>
44
45
61typedef struct FixedSizeAllocator
62#ifdef __cplusplus
63: public AllocatorIntf
64{
67
78 FixedSizeAllocator(void* buffer, size_t bufSize, size_t blockSize);
79
80#else
81{
82 AllocatorIntf super;
83#endif
84 SingleList freeList;
85 size_t blockSize;
87
88
89#ifdef __cplusplus
90extern "C" {
91#endif
100 void* buffer,
101 size_t bufSize,
102 size_t blockSize);
103#ifdef __cplusplus
104}
106 size_t bufSize,
107 size_t blockSize) {
108 FixedSizeAllocator_constructor(this, buffer, bufSize, blockSize);
109}
110#endif
111
112
113#endif
BA_API void FixedSizeAllocator_constructor(FixedSizeAllocator *o, void *buffer, size_t bufSize, size_t blockSize)
Initialize a fixed-size allocator in caller-provided storage.
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
This is a fixed size allocator implementation for the abstract interface class AllocatorIntf.
Definition: FixedSizeAllocator.h:64
FixedSizeAllocator()
Leave storage uninitialized; call FixedSizeAllocator_constructor before use.
Definition: FixedSizeAllocator.h:66