StateOS
Toggle main menu visibility
Loading...
Searching...
No Matches
osalloc.h
1
/******************************************************************************
2
3
@file StateOS: osalloc.h
4
@author Rajmund Szymanski
5
@date 02.05.2021
6
@brief This file contains definitions for StateOS.
7
8
******************************************************************************
9
10
Copyright (c) 2018-2022 Rajmund Szymanski. All rights reserved.
11
12
Permission is hereby granted, free of charge, to any person obtaining a copy
13
of this software and associated documentation files (the "Software"), to
14
deal in the Software without restriction, including without limitation the
15
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16
sell copies of the Software, and to permit persons to whom the Software is
17
furnished to do so, subject to the following conditions:
18
19
The above copyright notice and this permission notice shall be included
20
in all copies or substantial portions of the Software.
21
22
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28
IN THE SOFTWARE.
29
30
******************************************************************************/
31
32
#ifndef __STATEOSALLOC_H
33
#define __STATEOSALLOC_H
34
35
#include "oskernel.h"
36
42
43
#ifdef __cplusplus
44
extern
"C"
{
45
#endif
46
57
58
__STATIC_INLINE
59
void
*
sys_malloc
(
size_t
size ) {
return
malloc(size); }
60
68
69
__STATIC_INLINE
70
void
sys_free
(
void
*ptr ) { free(ptr); }
71
80
81
size_t
sys_heapSize
(
void
);
82
93
94
size_t
sys_segSize
(
void
*ptr );
95
96
/* -------------------------------------------------------------------------- */
97
98
#ifdef __cplusplus
99
}
100
#endif
101
102
/* -------------------------------------------------------------------------- */
103
105
106
#endif
//__STATEOSALLOC_H
sys_free
void sys_free(void *ptr)
system free procedure, deprecated
Definition
osalloc.h:70
sys_segSize
size_t sys_segSize(void *ptr)
get memory segment size
sys_malloc
void * sys_malloc(size_t size)
system malloc procedure, deprecated
Definition
osalloc.h:59
sys_heapSize
size_t sys_heapSize(void)
get total size of free blocks of the dedicated heap memory
kernel
osalloc.h
Generated by
1.18.0