terrafx.interop.mimalloc icon indicating copy to clipboard operation
terrafx.interop.mimalloc copied to clipboard

Support for Android and iOS

Open susices opened this issue 2 years ago • 2 comments

I'm interested in using this library in my project, but I noticed that currently it only supports win/mac/linux. I found that original mimalloc library now supports IOS according to their github issues. Is it possible to support Android and IOS platform for this library?

susices avatar Sep 26 '23 07:09 susices

The support should already exist, but it's not been validated as I have no way to test mobile devices in CI.

For v2.1.2 (the latest mimalloc) their OS abstraction layer is here: https://github.com/microsoft/mimalloc/tree/v2.1.2/src/prim and you'll note that they only have osx, unix, wasi, and windows. With osx deferring to unix and with unix representing both linux, mac, ios, android, bsd, etc.

For v1.6.7 (what has been ported so far) the OS abstraction layer is here: https://github.com/microsoft/mimalloc/blob/v1.6.7/src/os.c and you'll note that it also has essentially all the same target platforms supported.

In both cases, the unix support eventually defers down to mmap and so the general functionality should already light up anywhere mmap is supported. -- NOTE: That there might need to be some platform specific hookups enabled to ensure mmap is resolved to the correct native library, but I would expect that to be the only thing that might not work and in general is already setup for the typical expectations (msvcrt on Windows, libSystem on MacOS which should include iOS, and libc elsewhere)

tannergooding avatar Sep 26 '23 15:09 tannergooding