mempool: Remove unused defines
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 8 Mar 2024 20:47:25 +0000 (15:47 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 8 Mar 2024 20:47:25 +0000 (15:47 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I35f3ce87da25c47097bb76ab9c3aeadee46f5e32

src/rseq-mempool.c

index 56029071458c76d02a46b16759845347fdcfda67..674fa1e76a8ccd3f703d5cd33df14aa53f8193ec 100644 (file)
  * memory allocator provides CPU-Local Storage.
  */
 
-/*
- * Use high bits of per-CPU addresses to index the pool.
- * This leaves the low bits of available to the application for pointer
- * tagging (based on next power of 2 alignment of the allocations).
- */
-#if RSEQ_BITS_PER_LONG == 64
-# define POOL_INDEX_BITS       16
-#else
-# define POOL_INDEX_BITS       8
-#endif
-#define MAX_NR_POOLS           (1UL << POOL_INDEX_BITS)
-#define POOL_INDEX_SHIFT       (RSEQ_BITS_PER_LONG - POOL_INDEX_BITS)
-#define MAX_POOL_LEN           (1UL << POOL_INDEX_SHIFT)
-#define MAX_POOL_LEN_MASK      (MAX_POOL_LEN - 1)
-
-#define POOL_SET_NR_ENTRIES    POOL_INDEX_SHIFT
+#define POOL_SET_NR_ENTRIES    RSEQ_BITS_PER_LONG
 
 /*
  * Smallest allocation should hold enough space for a free list pointer.
@@ -537,7 +522,6 @@ struct rseq_percpu_pool *rseq_percpu_pool_create(const char *pool_name,
                percpu_stride = RSEQ_PERCPU_STRIDE;     /* Use default */
 
        if (max_nr_cpus < 0 || item_len > percpu_stride ||
-                       percpu_stride > (UINTPTR_MAX >> POOL_INDEX_BITS) ||
                        percpu_stride < (size_t) rseq_get_page_len() ||
                        !is_pow2(percpu_stride)) {
                errno = EINVAL;
This page took 0.025683 seconds and 4 git commands to generate.