~yolanda.robla/ubuntu/trusty/memcached/add_distribution

« back to all changes in this revision

Viewing changes to slabs.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-10-05 13:27:39 UTC
  • mfrom: (1.1.8 upstream) (3.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20111005132739-ntsnlj16fcze221i
Tags: 1.4.7-0.1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Run as 'memcache' user instead of nobody (LP #599461)
  - Depend on adduser for preinst/postrm
  - Create user in postinst

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
    do_slabs_stats(add_stats, c);
439
439
    pthread_mutex_unlock(&slabs_lock);
440
440
}
 
441
 
 
442
void slabs_adjust_mem_requested(unsigned int id, size_t old, size_t ntotal)
 
443
{
 
444
    pthread_mutex_lock(&slabs_lock);
 
445
    slabclass_t *p;
 
446
    if (id < POWER_SMALLEST || id > power_largest) {
 
447
        fprintf(stderr, "Internal error! Invalid slab class\n");
 
448
        abort();
 
449
    }
 
450
 
 
451
    p = &slabclass[id];
 
452
    p->requested = p->requested - old + ntotal;
 
453
    pthread_mutex_unlock(&slabs_lock);
 
454
}