Message70930
| Author |
dalke |
| Recipients |
dalke, pitrou |
| Date |
2008年08月09日.11:26:48 |
| SpamBayes Score |
6.4165165e-06 |
| Marked as misclassified |
No |
| Message-id |
<1218281216.04.0.602641395217.issue3531@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
You're right. I mistook the string implementation for the list one
which does keep a preallocated section in case of growth. Strings of
course don't grow so there's no need for that.
I tracked the memory allocation all the way down to
obmalloc.c:PyObject_Realloc . The call goes to realloc(p, nbytes) which
is a C lib call. It appears that the memory space is not reallocated.
That was enough to be able to find the python-dev thread "Darwin's
realloc(...) implementation never shrinks allocations" from Jan. 2005,
Bob Ippolito's post "realloc.. doesn’t?"
(http://bob.pythonmac.org/archives/2005/01/01/realloc-doesnt/ ) and Issue1092502 .
Mind you, I also get the problem on FreeBSD 2.6 so it isn't Darwin
specific. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年08月09日 11:26:56 | dalke | set | recipients:
+ dalke, pitrou |
| 2008年08月09日 11:26:56 | dalke | set | messageid: <1218281216.04.0.602641395217.issue3531@psf.upfronthosting.co.za> |
| 2008年08月09日 11:26:49 | dalke | link | issue3531 messages |
| 2008年08月09日 11:26:49 | dalke | create |
|