aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2013-09-23 21:28:06 -0700
committerPaul Eggert2013-09-23 21:28:06 -0700
commit7be68de5d25998e7d15aaab800c40cad48eac846 (patch)
tree881c8cdf8c60ee5c11bb3f00c7e27c09e162142b /src/alloc.c
parentd160dd0c71db061d819ce5ac337e4de8bd4f7d11 (diff)
downloademacs-7be68de5d25998e7d15aaab800c40cad48eac846.tar.gz
emacs-7be68de5d25998e7d15aaab800c40cad48eac846.zip
Some minor cleanups of recently-added bool vector code.
* conf_post.h (assume): Always return void. Use lint version only if GCC and MSC versions don't apply. * conf_post.h (assume): * data.c (USC_MSC_POPCOUNT, count_trailing_zero_bits): Depend on _MSC_VER, not __MSC_VER, for consistency with the rest of Emacs. * data.c (bool_vector_spare_mask, popcount_size_t_generic) (popcount_size_t_msc, popcount_size_t_gcc, popcount_size_t) (bool_vector_binop_driver, count_trailing_zero_bits) (size_t_to_host_endian): Now static, not static inline; the latter isn't needed with modern compilers and doesn't work with older compilers anyway.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 02742c4cf4a..e380d66cb1b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -981,7 +981,7 @@ struct ablocks
981#define ABLOCKS_BASE(abase) (abase) 981#define ABLOCKS_BASE(abase) (abase)
982#else 982#else
983#define ABLOCKS_BASE(abase) \ 983#define ABLOCKS_BASE(abase) \
984 (1 & (intptr_t) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1]) 984 (1 & (intptr_t) ABLOCKS_BUSY (abase) ? abase : ((void **)abase)[-1])
985#endif 985#endif
986 986
987/* The list of free ablock. */ 987/* The list of free ablock. */
@@ -1036,7 +1036,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
1036 1036
1037 aligned = (base == abase); 1037 aligned = (base == abase);
1038 if (!aligned) 1038 if (!aligned)
1039 ((void**)abase)[-1] = base; 1039 ((void **) abase)[-1] = base;
1040 1040
1041#ifdef DOUG_LEA_MALLOC 1041#ifdef DOUG_LEA_MALLOC
1042 /* Back to a reasonable maximum of mmap'ed areas. */ 1042 /* Back to a reasonable maximum of mmap'ed areas. */
@@ -2016,10 +2016,9 @@ INIT must be an integer that represents a character. */)
2016verify (sizeof (size_t) * CHAR_BIT == BITS_PER_SIZE_T); 2016verify (sizeof (size_t) * CHAR_BIT == BITS_PER_SIZE_T);
2017verify ((BITS_PER_SIZE_T & (BITS_PER_SIZE_T - 1)) == 0); 2017verify ((BITS_PER_SIZE_T & (BITS_PER_SIZE_T - 1)) == 0);
2018 2018
2019static 2019static ptrdiff_t
2020ptrdiff_t
2021bool_vector_payload_bytes (ptrdiff_t nr_bits, 2020bool_vector_payload_bytes (ptrdiff_t nr_bits,
2022 ptrdiff_t* exact_needed_bytes_out) 2021 ptrdiff_t *exact_needed_bytes_out)
2023{ 2022{
2024 ptrdiff_t exact_needed_bytes; 2023 ptrdiff_t exact_needed_bytes;
2025 ptrdiff_t needed_bytes; 2024 ptrdiff_t needed_bytes;
@@ -2068,7 +2067,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
2068 + total_payload_bytes), 2067 + total_payload_bytes),
2069 word_size) / word_size; 2068 word_size) / word_size;
2070 2069
2071 p = (struct Lisp_Bool_Vector* ) allocate_vector (needed_elements); 2070 p = (struct Lisp_Bool_Vector *) allocate_vector (needed_elements);
2072 XSETVECTOR (val, p); 2071 XSETVECTOR (val, p);
2073 XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0); 2072 XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0);
2074 2073
@@ -2617,9 +2616,9 @@ verify ((VECTOR_BLOCK_SIZE % roundup_size) == 0);
2617verify (VECTOR_BLOCK_SIZE <= (1 << PSEUDOVECTOR_SIZE_BITS)); 2616verify (VECTOR_BLOCK_SIZE <= (1 << PSEUDOVECTOR_SIZE_BITS));
2618 2617
2619/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at compile time. */ 2618/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at compile time. */
2620#define vroundup_ct(x) ROUNDUP((size_t)(x), roundup_size) 2619#define vroundup_ct(x) ROUNDUP ((size_t) (x), roundup_size)
2621/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at runtime. */ 2620/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at runtime. */
2622#define vroundup(x) (assume((x) >= 0), vroundup_ct(x)) 2621#define vroundup(x) (assume ((x) >= 0), vroundup_ct (x))
2623 2622
2624/* Rounding helps to maintain alignment constraints if USE_LSB_TAG. */ 2623/* Rounding helps to maintain alignment constraints if USE_LSB_TAG. */
2625 2624