stumpless  2.1.0
memory.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0 */
2 
3 /*
4  * Copyright 2018-2022 Joel E. Anderson
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
30 #ifndef __STUMPLESS_MEMORY_H
31 # define __STUMPLESS_MEMORY_H
32 
33 # include <stddef.h>
34 # include <stumpless/config.h>
35 
36 # ifdef __cplusplus
37 extern "C" {
38 # endif
39 
69 void
71 
94 void
96 
122 void *
123 ( *stumpless_set_malloc( void * ( *malloc_func )( size_t ) ) )
124 ( size_t );
125 
151 void
152 ( *stumpless_set_free( void ( *free_func )( void *) ) )
153 ( void * );
154 
180 void *
181 ( *stumpless_set_realloc( void * ( *realloc_func ) ( void *, size_t) ) )
182 ( void *, size_t );
183 
184 # ifdef __cplusplus
185 } /* extern "C" */
186 # endif
187 
188 #endif /* __STUMPLESS_MEMORY_H */
stumpless_free_all
void stumpless_free_all(void)
Closes the default target if it has been opened, frees all memory allocated internally,...
STUMPLESS_PUBLIC_FUNCTION
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
Definition: config.h:31
stumpless_set_realloc
void *(*)(void *, size_t) stumpless_set_realloc(void *(*realloc_func)(void *, size_t))
Sets the function used by the library to reallocate memory.
Definition: memory.h:181
stumpless_free_thread
void stumpless_free_thread(void)
Frees all memory allocated internally to the calling thread, and performs any other thread-specific c...
stumpless_set_malloc
void *(*)(size_t) stumpless_set_malloc(void *(*malloc_func)(size_t))
Sets the function used by the library to allocate memory.
Definition: memory.h:123
stumpless_set_free
void(*)(void *) stumpless_set_free(void(*free_func)(void *))
Sets the function used by the library to free memory.
Definition: memory.h:152
config.h