diff options
author | Karl Williamson <khw@cpan.org> | 2020-05-29 14:25:19 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-07-17 22:04:08 -0600 |
commit | d223e1ea9ae864c0e563187f1e76240ef1acad87 (patch) | |
tree | f670961d58ff3c055cff40637ca9daacaf1b462e /malloc.c | |
parent | 0654f0ab17405d0d55f0006348b4ed0084aa1fc8 (diff) | |
download | perl-d223e1ea9ae864c0e563187f1e76240ef1acad87.tar.gz |
handy.h: Create nBIT_MASK(n) macro
This encapsulates a common paradigm, making sure that it is done
correctly for the platform's size.
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -596,7 +596,7 @@ static const u_short buck_size[MAX_BUCKET_BY_TABLE + 1] = # define MAX_PACKED_POW2 6 # define MAX_PACKED (MAX_PACKED_POW2 * BUCKETS_PER_POW2 + BUCKET_POW2_SHIFT) # define MAX_POW2_ALGO ((1<<(MAX_PACKED_POW2 + 1)) - M_OVERHEAD) -# define TWOK_MASK ((1<<LOG_OF_MIN_ARENA) - 1) +# define TWOK_MASK nBITMASK(LOG_OF_MIN_ARENA) # define TWOK_MASKED(x) (PTR2UV(x) & ~TWOK_MASK) # define TWOK_SHIFT(x) (PTR2UV(x) & TWOK_MASK) # define OV_INDEXp(block) (INT2PTR(u_char*,TWOK_MASKED(block))) @@ -618,7 +618,7 @@ static const u_short buck_size[MAX_BUCKET_BY_TABLE + 1] = #ifdef IGNORE_SMALL_BAD_FREE #define FIRST_BUCKET_WITH_CHECK (6 * BUCKETS_PER_POW2) /* 64 */ # define N_BLKS(bucket) ( (bucket) < FIRST_BUCKET_WITH_CHECK \ - ? ((1<<LOG_OF_MIN_ARENA) - 1)/BUCKET_SIZE_NO_SURPLUS(bucket) \ + ? nBIT_MASK(LOG_OF_MIN_ARENA)/BUCKET_SIZE_NO_SURPLUS(bucket) \ : n_blks[bucket] ) #else # define N_BLKS(bucket) n_blks[bucket] |