(original) (raw)


On Jun 24, 2013, at 4:07 AM, Victor Stinner <victor.stinner@gmail.com> wrote:

Out of curiosity, do you know (remember) how was the number 62 chosen?
Is it a compromise between memory usage and performances? 62 is
surprising because it is not a power of two :-)

Is it to just have 64 (2+62) pointers in the structure?

Yes, the goal was to have the struct size be an exact multiple
of the cache line length (always a power-of-two, typically 64 bytes).
What was different then is that deques weren't indexable.
When indexing was added, the size of 62 became an
unfavorable choice because it made the division and modulo
calculation in deque\_index() slower than for a power of two.

For this specific case, I "hope" that nobody relies on the exact BLOCK
structure (since it is a private structure).

I don't know what you're talking about.
This structure isn't externally visible.


Raymond