Export memalign to linker
In order to support demangling of rust symbols by the linker, we are
adding a small Rust component. Rust expects `memalign` to be present in
hosted environments, and it doesn't appear costly to enable it.
Bug: 178565008
Test: m, killall -11 keystore2 produced mangled names in tombstone
Change-Id: I8fc749000fa02a3b760c8cc55be3348b9964d931
diff --git a/linker/linker_memory.cpp b/linker/linker_memory.cpp
index ce29997..456d254 100644
--- a/linker/linker_memory.cpp
+++ b/linker/linker_memory.cpp
@@ -72,6 +72,10 @@
return get_allocator().alloc(byte_count);
}
+void* memalign(size_t alignment, size_t byte_count) {
+ return get_allocator().memalign(alignment, byte_count);
+}
+
void* calloc(size_t item_count, size_t item_size) {
return get_allocator().alloc(item_count*item_size);
}