Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
t
u
v
w
Functions
_
c
d
g
m
o
p
r
t
v
w
Variables
_
a
c
d
e
f
h
i
k
l
m
n
p
r
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
m
o
p
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
_
a
b
d
e
f
g
h
i
j
l
m
p
s
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
extern
porcupine
demo
mcu
stm32f469
stm32f469i-disco
Src
stm32f469/stm32f469i-disco/Src/sysmem.c
Go to the documentation of this file.
1
24
/* Includes */
25
#include <errno.h>
26
#include <stdint.h>
27
31
static
uint8_t *
__sbrk_heap_end
=
NULL
;
32
54
void
*
_sbrk
(ptrdiff_t incr)
55
{
56
extern
uint8_t _end;
/* Symbol defined in the linker script */
57
extern
uint8_t _estack;
/* Symbol defined in the linker script */
58
extern
uint32_t _Min_Stack_Size;
/* Symbol defined in the linker script */
59
const
uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
60
const
uint8_t *max_heap = (uint8_t *)stack_limit;
61
uint8_t *prev_heap_end;
62
63
/* Initalize heap end at first call */
64
if
(
NULL
==
__sbrk_heap_end
)
65
{
66
__sbrk_heap_end
= &_end;
67
}
68
69
/* Protect heap from growing into the reserved MSP stack */
70
if
(
__sbrk_heap_end
+ incr > max_heap)
71
{
72
errno
= ENOMEM;
73
return
(
void
*)-1;
74
}
75
76
prev_heap_end =
__sbrk_heap_end
;
77
__sbrk_heap_end
+= incr;
78
79
return
(
void
*)prev_heap_end;
80
}
NULL
#define NULL
Definition:
porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/speex_resampler/thirdparty/resample.c:92
errno
int errno
_sbrk
void * _sbrk(ptrdiff_t incr)
_sbrk() allocates memory to the newlib heap and is used by malloc and others from the C library
Definition:
stm32f469/stm32f469i-disco/Src/sysmem.c:54
__sbrk_heap_end
static uint8_t * __sbrk_heap_end
Definition:
stm32f469/stm32f469i-disco/Src/sysmem.c:31
picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:55