Commit Graph

11 Commits

Author SHA1 Message Date
vms
d2482b786a
activate the use of __heap_base (#215) 2020-09-23 18:14:32 -07:00
Dan Gohman
0cc57ac7b4
Multi-license wasi-libc under Apache and MIT licenses. (#174)
Multi-license wasi-libc under the Apache-2.0 WITH LLVM-exception,
Apache-2.0, and MIT licenses.
2020-02-29 10:52:28 +01:00
Dan Gohman
12f5832b45
Convert more wasi-libc code to //-style comments. (#153)
This is purely a style change, in accordance with #116.
2020-01-16 16:00:37 -08:00
Dan Gohman
ec4549dabc
Temporarily disable the use of __heap_base. (#132)
This temporarily disables the feature in
a214f1c0b1, since it hits LLVM bug
43613, which is fixed on LLVM master and awaiting a backport to
the 9.0 branch.

https://bugs.llvm.org/show_bug.cgi?id=43613
2019-11-07 13:09:31 -08:00
vms
a214f1c0b1 Use __heap_base by dlmalloc (#114)
* add explicit allocator initialization

* move init to a better place

* fix warnings

* add __wasilibc_try_init_allocator

* move initialization to dlmalloc()

* fix typos

* fix identations

* follow style guide

* review changes
2019-11-05 12:52:51 -08:00
Dan Gohman
78b8651224
Remove -fno-builtin. (#104)
* Remove -fno-builtin.

-fno-builtin suppresses optimizations such as turning calls to `sqrt`
or `fabs` into `f64.sqrt` or `f64.abs` instructions inline. Libc code
itself benefits from these optimizations.

I originally added this flag because historically it was needed when
building libc to avoid the compiler pattern-matching the body of memcpy
into a memcpy call, however clang no longer requires this.

* Expand the comment about why we use USE_DL_PREFIX in dlmalloc.
2019-10-11 05:07:34 -07:00
Dan Gohman
c9a573306f Set the MALLOC_ALIGNMENT to 16.
This isn't strictly required, as wasm SIMD loads and stores work on
unaligned memory. However, it may provide better performance. That said,
this isn't currently studied by any benchmarking.
2019-09-07 07:22:18 -07:00
Dan Gohman
0df6243d52 Make calloc set ENOMEM when failing due to overflow.
This fixes a bug in upstream dlmalloc, where it doesn't set errno to
ENOMEM in overflow or footprint overrun cases.
2019-04-23 15:00:40 -07:00
Dan Gohman
7ba6adfc61 Fix miscellaneous lint warnings. 2019-04-15 09:47:16 -07:00
Dan Gohman
320054e84f WASI libc prototype implementation.
This incoporates pieces from musl-libc, cloudlibc, cloudabi, libpreopen,
and dlmalloc, as well as a significant amount of new code.
2019-03-27 07:59:55 -07:00
Dan Gohman
dbfccac2e4 Add a malloc implementation using dlmalloc. 2019-01-10 15:42:34 -08:00