Salad  1.0.15
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
memory.h
Go to the documentation of this file.
1 /*
2  * Salad - An assortment of useful C stuff
3  * Copyright (C) 2016 Lloyd Dilley
4  * http://www.dilley.me/
5  *
6  * This file is part of Salad.
7  *
8  * Salad is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version
11  * 3 of the License, or (at your option) any later version.
12  *
13  * Salad is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Salad. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef MEMORY_H
23 #define MEMORY_H
24 
25 #include "salad/types.h"
26 
34 #define POOL_GROW_AMOUNT 16
35 
46 
57 
68 
79 
90 
101 
111 
119 void sld_memory_pool_nuke();
120 
123 #endif /* MEMORY_H */
unsigned short int SLD_USINT
Definition: types.h:50
SLD_ULINT sld_memory_pool_add(void *ptr)
Adds an object to the memory pool.
Definition: memory.c:102
SLD_BOOL sld_memory_pool_initialized()
Checks whether or not the memory pool is initialized.
Definition: memory.c:58
SLD_SSINT sld_memory_pool_resize(SLD_ULINT new_size)
Resizes the memory pool to the specified size.
Definition: memory.c:73
SLD_ULINT sld_memory_pool_free()
Frees any memory allocated for objects stored in the memory pool.
Definition: memory.c:142
SLD_ULINT sld_memory_pool_size()
Returns the size of the memory pool.
Definition: memory.c:68
signed short int SLD_SSINT
Definition: types.h:47
SLD_USINT SLD_BOOL
Definition: types.h:65
void sld_memory_pool_nuke()
Frees any memory allocated for the initialized memory pool.
Definition: memory.c:162
SLD_ULINT sld_memory_pool_objects()
Returns the total number of objects in the memory pool.
Definition: memory.c:125
SLD_SSINT sld_memory_pool_init(SLD_USINT initial_size)
Initialize a memory pool with the specified size.
Definition: memory.c:36
unsigned long int SLD_ULINT
Definition: types.h:62