Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android patches - lzham_core.h config & workaround for missing malloc_usable_size() #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fearog
Copy link

@fearog fearog commented Jun 30, 2015

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.

… allocation wrapper to work around the lack of a malloc_usable_size() equivalent.
@richgel999 richgel999 mentioned this pull request Nov 4, 2016
@GregSlazinski
Copy link

GregSlazinski commented Apr 4, 2019

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

@gvollant
Copy link

See my own patch here, which is much simpler than proposed solution,
Esenthel/EsenthelEngine@e4c5160#diff-0f68d553aebdf2e6a072f2c0928455f0

I suggest you publish another Pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants