A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023677.html below:

[Python-Dev] pymalloc and overallocation (unicodeobject.c,2.139,2.140 checkin)

[Python-Dev] pymalloc and overallocation (unicodeobject.c,2.139,2.140 checkin)Martin v. Loewis martin@v.loewis.de
26 Apr 2002 20:57:39 +0200
Tim Peters <tim.one@comcast.net> writes:

> But Marc-Andre uses realloc at the end to return the excess.  The excess
> bytes will get reused (and some returned yet again) by the next
> overallocation, and so on.  

Right. I confused this with the fact that PyMem_Realloc won't return
the excess memory, so the extra bytes in a small string will be wasted
for the life time of the string object - that still could cause
significant memory wastage.

> MAL, you should keep in mind that pymalloc is also managing the small chunks
> in your scheme:  when you're fiddling with a 40-character Unicode string, an
> overallocation "by a factor of 4" only amounts to an 80-character UTF8
> string.  

[I guess this is a terminology, not a math problem: a 40 character
Unicode string has already 80 bytes; the UTF-8 of it can have up
to 160 bytes].

Regards,
Martin




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4