L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
alloc.h
Go to the documentation of this file.
1
5/*
6 * (c) 2004-2009 Alexander Warg <warg@os.inf.tu-dresden.de>,
7 * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
8 * economic rights: Technische Universität Dresden (Germany)
9 *
10 * License: see LICENSE.spdx (in this directory or the directories above)
11 */
12#pragma once
13
14namespace L4 {
15
21 {
22 public:
23 Alloc_list() : _free(0) {}
24 Alloc_list(void *blk, unsigned long size) : _free(0)
25 { free( blk, size); }
26
27 void free(void *blk, unsigned long size);
28 void *alloc(unsigned long size);
29
30 private:
31 struct Elem
32 {
33 Elem *next;
34 unsigned long size;
35 };
36
37 Elem *_free;
38 };
39}
A simple list-based allocator.
Definition alloc.h:21
L4 low-level kernel interface.