Skip to content

Commit

Permalink
Remove slab size special case for growth factor 2. bug56
Browse files Browse the repository at this point in the history
Using any growth factor, the minimum slab size is always 104 bytes
(unless using -n option to use a specific value) except for 2. In this
case, it's 128 bytes and cannot be reduced using -n option (it can be
increased however).

From slabs.c:
    /* Factor of 2.0 means use the default memcached behavior */
    if (factor == 2.0 && size < 128)
        size = 128;

What I sugget is to simply remove this part. If the default behaviour
needs to be kept to 128 bytes per default when factor is 128, maybe
default value could for the -n option could be adapted to do so. But I
don't see a good reason for this specific difference between factor 2
and others.
  • Loading branch information
Colin Pitrat authored and dustin committed Oct 29, 2009
1 parent f13f1df commit 47ab3b0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions slabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ void slabs_init(const size_t limit, const double factor, const bool prealloc) {
int i = POWER_SMALLEST - 1;
unsigned int size = sizeof(item) + settings.chunk_size;

/* Factor of 2.0 means use the default memcached behavior */
if (factor == 2.0 && size < 128)
size = 128;

mem_limit = limit;

if (prealloc) {
Expand Down

0 comments on commit 47ab3b0

Please sign in to comment.