cython/cython — pull request #340 by larsmans (2014-12-10 20:52:40+00:00)
Title: fix shrinking and overflow in cpython.array

I found two bugs in `cpython.array.resize_smart`:

* it's impossible to shrink the array, except to a size that is less then ¼ of the current size (in fact the array may grow when shrinking by a few elements is requested);
* the calculation of `newsize` could overflow.

This patch fixes both bugs. I took the easy way out: never actually shrink the allocation, just decrease the size.