slabs.c File Reference

#include "memcached.h"
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>

Include dependency graph for slabs.c:


Classes

struct  slabclass_t

Functions

unsigned int slabs_clsid (const size_t size)
 Given object size, return id to use when allocating/freeing memory for object 0 means error: can't store such a large object.
void slabs_init (const size_t limit, const double factor, const bool prealloc)
 Determines the chunk sizes and initializes the slab class descriptors accordingly.
bool get_stats (const char *stat_type, int nkey, ADD_STAT add_stats, void *c)
 Return a datum for stats in binary protocol.
void * slabs_alloc (size_t size, unsigned int id)
 Allocate object of given length.
void slabs_free (void *ptr, size_t size, unsigned int id)
 Free previously allocated object.
void slabs_stats (ADD_STAT add_stats, void *c)
 Fill buffer with stats.

Function Documentation

bool get_stats ( const char *  stat_type,
int  nkey,
ADD_STAT  add_stats,
void *  c 
)

Return a datum for stats in binary protocol.

Here is the call graph for this function:

void* slabs_alloc ( const size_t  size,
unsigned int  id 
)

Allocate object of given length.

0 on error

Here is the caller graph for this function:

unsigned int slabs_clsid ( const size_t  size  ) 

Given object size, return id to use when allocating/freeing memory for object 0 means error: can't store such a large object.

Here is the caller graph for this function:

void slabs_free ( void *  ptr,
size_t  size,
unsigned int  id 
)

Free previously allocated object.

Here is the caller graph for this function:

void slabs_init ( const size_t  limit,
const double  factor,
const bool  prealloc 
)

Determines the chunk sizes and initializes the slab class descriptors accordingly.

Init the subsystem.

Here is the caller graph for this function:

void slabs_stats ( ADD_STAT  add_stats,
void *  c 
)

Fill buffer with stats.

Here is the caller graph for this function:


Generated on Fri Apr 17 15:14:54 2009 for memcached by  doxygen 1.5.8