A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-June/045408.html below:

[Python-Dev] Object free lists

[Python-Dev] Object free lists [Python-Dev] Object free listsTim Peters tim.one at comcast.net
Tue Jun 15 23:21:45 EDT 2004
[Bob Ippolito]
> The implementation of malloc in OS X always returns pointers aligned to
> 16-byte boundaries, so that the buffers can be reasonably used by AltiVec
> instructions.  Would there be a difference in this case? :)

The int object free list is carved out of larger contiguous blocks, 12 bytes
(on most boxes) at a time -- see the code for details:

struct _intblock {
	struct _intblock *next;
	PyIntObject objects[N_INTOBJECTS];
};

If we had hidden malloc overhead bytes per object, pymalloc would probably
be more space-efficient than the platform malloc.  If the OS X C compiler
says sizeof(PyIntObject) == 16 (which it may or may not do, independent of
what malloc() likes best), then int objects will indeed consume 16 bytes
apiece despite Python's attempt to be more space-efficient than that.



More information about the Python-Dev mailing list

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