stm/stm_mm.h
inline size_t GetAlignedSize(size_t initial_size, size_t padding)
        {
            // add the header size to get the minimum contiguous block
            size_t aligned_size = initial_size + padding;

            // pad everything to a multiple of 8 in case size > 1024
            if (aligned_size % 64 != 0)
                aligned_size += 64 - (aligned_size % 64);

            if      (aligned_size > 2048) return aligned_size;
            else if (aligned_size > 1024) return 2048;
            else if (aligned_size >  512) return 1024;
            else if (aligned_size >  256) return 512;
            else if (aligned_size >  128) return 256;
            else if (aligned_size >   64) return 128;
            else return 64;
        }
// all block sizes must be multiples of 64 in order to ensure alignment
// of longlong variables and to ensure that we don't have
// cacheline-based conflicts.  Also, we're going to make all sizes upto
// 2048 be exact powers of 2
all block sizes must be multiples of 64 in order to ensure alignment
of longlong variables and to ensure that we don't have
cacheline-based conflicts.  Also, we're going to make all sizes upto
2048 be exact powers of 2
all block sizes must be multiples of 64 in order to ensure alignment of longlong variables and to ensure that we don ' t have cacheline - based conflicts . Also we ' re going to make all sizes upto 2048 be exact powers of 2
inline size_t GetAlignedSize(size_t initial_size, size_t padding)
        {
            size_t aligned_size = initial_size + padding;
            if (aligned_size % 64 != 0)
                aligned_size += 64 - (aligned_size % 64);
            if      (aligned_size > 2048) return aligned_size;
            else if (aligned_size > 1024) return 2048;
            else if (aligned_size >  512) return 1024;
            else if (aligned_size >  256) return 512;
            else if (aligned_size >  128) return 256;
            else if (aligned_size >   64) return 128;
            else return 64;
        }
inline size_t GetAlignedSize ( size_t initial_size , size_t padding ) { size_t aligned_size = initial_size + padding ; if ( aligned_size % 64 != 0 ) aligned_size += 64 - ( aligned_size % 64 ) ; if ( aligned_size > 2048 ) return aligned_size ; else if ( aligned_size > 1024 ) return 2048 ; else if ( aligned_size > 512 ) return 1024 ; else if ( aligned_size > 256 ) return 512 ; else if ( aligned_size > 128 ) return 256 ; else if ( aligned_size > 64 ) return 128 ; else return 64 ; }
all block sizes must be multiples of 64 in order to ensure alignment
of longlong variables and to ensure that we don't have
cacheline-based conflicts.
all block sizes must be multiples of 64 in order to ensure alignment of longlong variables and to ensure that we don ' t have cacheline - based conflicts .
// add the header size to get the minimum contiguous block // pad everything to a multiple of 8 in case size > 1024