numpy/numpy — pull request #4128 by longjon (2013-12-18 00:35:21+00:00)
Title: Avoid overallocating memory in arraypad with user supplied function

Previously, arraypad used zeros(shape).astype(dtype) instead of
zeros(shape, dtype), which could allocate up to eight times more memory
than necessary.