[AppleScript] 纯文本查看 复制代码
/* This over-allocates proportional to the list size, mak ing room * for additional growth. The over-allocation is mild, b ut is * enough to give linear-time amortized behavior over a l ong * sequence of appends() in the presence of a poorly-perf orming * system realloc(). * The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 7 2, 88, ... */ new_allocated = (newsize >> 3) + (newsize < 9 ? 3 : 6);[/size][/font]
[font=微软雅黑][size=3] /* check for integer overflow */ if (new_allocated > PY_SIZE_MAX - newsize) { PyErr_NoMemory(); return -1; } else { new_allocated += newsize; }