Skip to content

Commit 2e53589

Browse files
stephanosioRushybrook
authored andcommitted
Revert "lib: newlib: Add workaround for zephyrproject-rtos#38258"
The commit 9bd1483 was added as a workaround for the Xtensa initial malloc failure bug. This bug has been fixed in the Zephyr SDK 0.13.1 release and therefore this workaround is no longer needed. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent 0247379 commit 2e53589

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/libc/newlib/libc-hooks.c

-14
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,6 @@ static int malloc_prepare(const struct device *unused)
130130
"minimum required size specified by "
131131
"CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE");
132132

133-
#ifdef CONFIG_XTENSA
134-
/*
135-
* FIXME: For Xtensa, the first `malloc` call may fail if the HEAP_BASE
136-
* is such that the first `sbrk` call returns a 4096-byte
137-
* aligned address.
138-
*
139-
* This is a very ugly workaround for the issue #38258 and must
140-
* be removed once it is fixed.
141-
*/
142-
void *ptr = malloc(16);
143-
144-
free(ptr);
145-
#endif /* CONFIG_XTENSA */
146-
147133
return 0;
148134
}
149135

0 commit comments

Comments
 (0)