Skip to content

Support customize FL_INDEX_MAX to reduce the memory overhead - #19

Open
xiaoxiang781216 wants to merge 1 commit into
mattconte:masterfrom
xiaoxiang781216:log2
Open

Support customize FL_INDEX_MAX to reduce the memory overhead#19
xiaoxiang781216 wants to merge 1 commit into
mattconte:masterfrom
xiaoxiang781216:log2

Conversation

@xiaoxiang781216

Copy link
Copy Markdown

user can define the max pool size through TLSF_MAX_POOL_SIZE

Comment thread tlsf.c
Comment thread 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
Copy Markdown

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
Copy Markdown
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 <xiaoxiang@xiaomi.com>
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