k_alloc_malloc.h
Go to the documentation of this file.
1 /*
2  * KubOS Core Flight Services
3  * Copyright (C) 2016 Kubos Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
27 #ifndef K_ALLOC_MALLOC_H
28 #define K_ALLOC_MALLOC_H
29 
30 #include "kubos-core/k_alloc.h"
31 #include <stdlib.h>
32 
33 void * malloc_new(size_t size);
34 void malloc_free(void * ptr);
35 void * malloc_realloc(void * buff, size_t old_size, size_t new_size);
36 void k_alloc_malloc_init();
37 
39 
40 #define K_BUFFER_NEW_MALLOC(n, d, s) \
41  k_buffer_alloc(n, d, s, &malloc_alloc)
42 
43 #define K_BUFFER_FREE_MALLOC(b) \
44  k_buffer_free_new(b, &malloc_alloc)
45 
46 #define K_BUFFER_REALLOC_MALLOC(b, s) \
47  k_buffer_realloc_new(b, s, &malloc_alloc)
48 
49 
50 #endif
void malloc_free(void *ptr)
void k_alloc_malloc_init()
Buffer Allocator Wrapper.
k_alloc_t malloc_alloc
Definition: k_alloc_malloc.h:38
void * malloc_new(size_t size)
Definition: k_alloc.h:38
void * malloc_realloc(void *buff, size_t old_size, size_t new_size)