Там не в два раза больше, но суть такая же
new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3
/* This over-allocates proportional to the list size, making room * for additional growth. The over-allocation is mild, but is * enough to give linear-time amortized behavior over a long * sequence of appends() in the presence of a poorly-performing * system realloc(). * Add padding to make the allocated size multiple of 4. * The growth pattern is: 0, 4, 8, 16, 24, 32, 40, 52, 64, 76,
Прикольно, думал что константа 2