ck_bag: Fix usage of CK_MD_VMA_BITS.

ck_pring
Abel Mathew 13 years ago
parent ec02b2f356
commit 00d0320767

@ -63,8 +63,8 @@ enum ck_bag_allocation_strategy {
}; };
/* /*
* max: max n_entries per block * max: max n_entries per block
* bytes: sizeof(ck_bag_block) + sizeof(flex. array member) * bytes: sizeof(ck_bag_block) + sizeof(flex. array member)
* + inline allocator overhead * + inline allocator overhead
*/ */
struct ck_bag_block_info { struct ck_bag_block_info {
@ -114,8 +114,7 @@ struct ck_bag_iterator {
typedef struct ck_bag_iterator ck_bag_iterator_t; typedef struct ck_bag_iterator ck_bag_iterator_t;
#ifdef CK_BAG_PP #ifdef CK_BAG_PP
#define CK_BAG_KEY_LENGTH ((sizeof(void *) * 8) - CK_MD_VMA_BITS) #define CK_BAG_BLOCK_ENTRIES_MASK (~(uintptr_t)0 << CK_MD_VMA_BITS)
#define CK_BAG_BLOCK_ENTRIES_MASK ((uintptr_t)(1U << CK_BAG_KEY_LENGTH) << CK_MD_VMA_BITS)
#endif #endif
CK_CC_INLINE static struct ck_bag_block * CK_CC_INLINE static struct ck_bag_block *

@ -37,7 +37,7 @@
#define CK_BAG_PAGESIZE CK_MD_PAGESIZE #define CK_BAG_PAGESIZE CK_MD_PAGESIZE
#ifdef CK_BAG_PP #ifdef CK_BAG_PP
#define CK_BAG_MAX_N_ENTRIES (1 << 12) #define CK_BAG_MAX_N_ENTRIES (1 << ((sizeof(void *) * 8) - CK_MD_VMA_BITS))
#endif #endif
static struct ck_malloc allocator; static struct ck_malloc allocator;

Loading…
Cancel
Save