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

Use __builtin_ctz and __builtin_clz in dlmalloc #401

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dlmalloc/src/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ static size_t traverse_and_check(mstate m);
#define treebin_at(M,i) (&((M)->treebins[i]))

/* assign tree index for size S to variable I. Use x86 asm if possible */
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__) || defined(__wasm__))
#define compute_tree_index(S, I)\
{\
unsigned int X = S >> TREEBIN_SHIFT;\
Expand Down Expand Up @@ -2942,7 +2942,7 @@ static size_t traverse_and_check(mstate m);

/* index corresponding to given bit. Use x86 asm if possible */

#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__) || defined(__wasm__))
#define compute_bit2idx(X, I)\
{\
unsigned int J;\
Expand Down