Move the leftlink to the end of the block structure.

The current pattern of memory access will update both the leftlink and
rightlink at the same time, so they should be positioned side-by-side
for better cache locality.

Keeping the leftlink at the front of the structure would make sense
only if the paired updates were eliminated by backporting changesets
49a9c734304d, 3555cc0ca35b, ae9ee46bd471, and 744dd749e25b.  However,
that isn't likely to happen, so we're better off with the leftlink at
the end of the structure.
This commit is contained in:
Raymond Hettinger 2013-07-16 01:59:30 -07:00
parent b7a285f528
commit 90180c1c3f
1 changed files with 1 additions and 1 deletions

View File

@ -47,9 +47,9 @@
*/
typedef struct BLOCK {
struct BLOCK *leftlink;
PyObject *data[BLOCKLEN];
struct BLOCK *rightlink;
struct BLOCK *leftlink;
} block;
#define MAXFREEBLOCKS 10