4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-23 23:47:22 +08:00
Szabolcs Nagy e7b7406d67 Reimplement aligned_alloc
The original implementation had multiple issues:

- Only worked when posix_memalign was available (Linux, RTEMS).
- Violated C11 link namespace rules by calling posix_memalign.
- Failed to set errno on error.

These can be fixed by essentially using the same implementation
for aligned_alloc as for memalign, i.e. simply calling _memalign_r
(which is always available and a "more reserved name" although
technically still not in the reserved link namespace, at least
code written in c cannot define a colliding symbol, newlib has
plenty such namespace issues so this is fine).

It is not clear what the right policy is when MALLOC_PROVIDED is set,
currently that does not cover aligned_alloc so it is kept that way.

Tested on aarch64-none-elf
2020-10-14 10:54:19 -04:00
..
2018-01-17 11:47:26 -06:00
2017-12-07 11:54:11 +00:00
2018-01-17 11:47:26 -06:00
2020-10-14 10:54:19 -04:00
2018-01-17 11:47:30 -06:00
2020-10-14 10:54:08 -04:00
2017-11-29 11:25:46 -06:00
2017-11-29 11:25:45 -06:00
2017-11-29 11:25:45 -06:00
2017-11-29 11:25:46 -06:00
2017-11-29 11:25:46 -06:00