Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4522ca6

Browse filesBrowse files
committed
Fix __malloc_lock/unlock prototype change in newlib
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 8e66896 commit 4522ca6
Copy full SHA for 4522ca6

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed

‎portable/MemMang/heap_useNewlib.c

Copy file name to clipboardExpand all lines: portable/MemMang/heap_useNewlib.c
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ char * sbrk(int incr) {
109109
//! Synonym for sbrk.
110110
char * _sbrk(int incr) { return sbrk(incr); };
111111

112+
#if (__NEWLIB__ >= 3)
113+
void __malloc_lock(struct _reent *ptr __attribute__((__unused__))) { vTaskSuspendAll(); };
114+
void __malloc_unlock(struct _reent *ptr __attribute__((__unused__))) { (void)xTaskResumeAll(); };
115+
#else
112116
void __malloc_lock() { vTaskSuspendAll(); };
113117
void __malloc_unlock() { (void)xTaskResumeAll(); };
118+
#endif
114119

115120
// newlib also requires implementing locks for the application's environment memory space,
116121
// accessed by newlib's setenv() and getenv() functions.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.