On Jun 3, 1:03 am, Dustin <[email protected]> wrote: > On Jun 2, 5:03 pm, Mat Hostetter <[email protected]> wrote: > > > In items.c in memcached-1.2.8, these arrays allow indices up to but > > not including LARGEST_ID: > > Good calls. For bonus points, do you think you can contrive some > tests that trigger these? :)
I think it's actually impossible to trigger this fencepost problem, because the maximum possible slab class ID (POWER_LARGEST) is smaller than LARGEST_ID. The code is "wrong" but it doesn't matter. If I ran the zoo, I would clean this up by unifying POWER_LARGEST and LARGEST_ID. I think it's reasonable for the slab allocator to export the largest value slab_clsid() can possibly return,rather than making the caller guess. This has the minor benefit that various items.c arrays would not waste 54 entries for impossible slab class IDs. -Mat
