RE: [PATCH v11 3/6] ptr_compress: add pointer compression library

2024-06-06 Thread Konstantin Ananyev
> +/** > + * Compress pointers into 32-bit offsets from base pointer. > + * > + * @note It is programmer's responsibility to ensure the resulting offsets > fit > + * into 32 bits. Alignment of the structures pointed to by the pointers > allows > + * us to drop bits from the offsets. This is co

RE: [PATCH v11 3/6] ptr_compress: add pointer compression library

2024-05-24 Thread Morten Brørup
> +#define BITS_REQUIRED_TO_STORE_VALUE(x) \ > + ((x) == 0 ? 1 : (sizeof(size_t) * CHAR_BIT - __builtin_clzl((size_t)x))) > + > +#define BIT_SHIFT_FROM_ALIGNMENT(x) ((x) == 0 ? 0 : __builtin_ctzl(x)) The two built-ins used are not available with MSVC. Please see if you can find similar functio