k_alloc_csp.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 
18 
28 #ifndef K_ALLOC_CSP_H
29 #define K_ALLOC_CSP_H
30 
31 #include "kubos-core/k_alloc.h"
32 #include <stdlib.h>
33 
34 #define CSP_BUFFER_SIZE 60
35 #define CSP_BUFFER_COUNT 10
36 
37 void * _csp_new(size_t size);
38 void _csp_free(void * ptr);
39 void * _csp_realloc(void * buff, size_t old_size, size_t new_size);
40 void k_alloc_csp_init();
41 
43 
44 #define K_BUFFER_NEW_CSP(n, d, s) \
45  k_buffer_alloc(n, d, s, &csp_alloc)
46 
47 #define K_BUFFER_FREE_CSP(b) \
48  k_buffer_free_new(b, &csp_alloc)
49 
50 #define K_BUFFER_REALLOC_CSP(b, s) \
51  k_buffer_realloc_new(b, s, &csp_alloc)
52 
53 #endif
void * _csp_new(size_t size)
void _csp_free(void *ptr)
Buffer Allocator Wrapper.
void k_alloc_csp_init()
k_alloc_t csp_alloc
Definition: k_alloc_csp.h:42
Definition: k_alloc.h:38
void * _csp_realloc(void *buff, size_t old_size, size_t new_size)