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

Support customize FL_INDEX_MAX to reduce the memory overhead #19

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

Conversation

xiaoxiang781216
Copy link

user can define the max pool size through TLSF_MAX_POOL_SIZE

tlsf.c Show resolved Hide resolved
tlsf.c Outdated
** or if n is zero, returns zero.
*/
#ifdef TLSF_64BIT
#define TLSF_FLS(n) ((n) & 0xffffffff00000000ull ? 32 + TLSF_FLS32((n) >> 32) : TLSF_FLS32(n))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider to change the:
((n) >> 32)
to:
((size_t)(n) >> 32)

because of warning with MSVC:
tlsf.c:252: warning: C4293: '>>': shift count negative or too big, undefined behavior

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please try again.

user can define the max pool size through TLSF_MAX_POOL_SIZE

Signed-off-by: Xiang Xiao <[email protected]>
Change-Id: I021b816f65c1bc5c1025969bc6cc458029f3bc88
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.

2 participants