[TS] Wrap `aligned_alloc` as well as other malloc's.
[ldk-java] / typescript_strings.py
index 2979481d1e9ab4648d4d532246e090284923e3ea..7d63af91a69f405765cdfd67c54fb31eea1c07c4 100644 (file)
@@ -376,8 +376,9 @@ typedef struct allocation {
 static allocation* allocation_ll = NULL;
 static allocation* freed_ll = NULL;
 
-void* __real_malloc(size_t len);
-void* __real_calloc(size_t nmemb, size_t len);
+extern void* __real_malloc(size_t len);
+extern void* __real_calloc(size_t nmemb, size_t len);
+extern void* __real_aligned_alloc(size_t alignment, size_t size);
 static void new_allocation(void* res, const char* struct_name, int lineno) {
        allocation* new_alloc = __real_malloc(sizeof(allocation));
        new_alloc->ptr = res;
@@ -450,6 +451,11 @@ void* __wrap_calloc(size_t nmemb, size_t len) {
        new_allocation(res, "calloc call", 0);
        return res;
 }
+void* __wrap_aligned_alloc(size_t alignment, size_t size) {
+       void* res = __real_aligned_alloc(alignment, size);
+       new_allocation(res, "aligned_alloc call", 0);
+       return res;
+}
 void __wrap_free(void* ptr) {
        if (ptr == NULL) return;
        alloc_freed(ptr, 0);