Open fearog opened 9 years ago
On Android API 17 and above, 'malloc_usable_size' is present. however returned addresses from 'malloc' do NOT meet LZHAM_MIN_ALLOC_ALIGNMENT requirements (tested on 64-bit binary). See my own patch here, which is much simpler than proposed solution, https://github.com/Esenthel/EsenthelEngine/commit/e4c5160e2581ffb9da3121787190862fae3509c6#diff-0f68d553aebdf2e6a072f2c0928455f0
See my own patch here, which is much simpler than proposed solution, Esenthel/EsenthelEngine@e4c5160#diff-0f68d553aebdf2e6a072f2c0928455f0
I suggest you publish another Pull request
There is no malloc_usable_size() equivalent on Android, it was deprecated some time back. So we need to manage tracking allocation sizes ourselves. I chose to do it by including the size as a prefix to the allocation, just like what is done with the array sizes.
I only had a quick look for spin lock, but it appears to be missing on Android. So I disabled pthreads for now on Android.