"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/sizes.c" (21 Feb 2022, 1152 Bytes) of package /linux/www/memcached-1.6.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "sizes.c" see the Fossies "Dox" file reference documentation.

    1 #include <stdio.h>
    2 
    3 #include "memcached.h"
    4 
    5 static void display(const char *name, size_t size) {
    6     printf("%s\t%d\n", name, (int)size);
    7 }
    8 
    9 int main(int argc, char **argv) {
   10 
   11     display("Slab Stats", sizeof(struct slab_stats));
   12     display("Thread stats",
   13             sizeof(struct thread_stats)
   14             - (200 * sizeof(struct slab_stats)));
   15     display("Global stats", sizeof(struct stats));
   16     display("Settings", sizeof(struct settings));
   17     display("Item (no cas)", sizeof(item));
   18     display("Item (cas)", sizeof(item) + sizeof(uint64_t));
   19 #ifdef EXTSTORE
   20     display("extstore header", sizeof(item_hdr));
   21 #endif
   22     display("Libevent thread",
   23             sizeof(LIBEVENT_THREAD) - sizeof(struct thread_stats));
   24     display("Connection", sizeof(conn));
   25     display("Response object", sizeof(mc_resp));
   26     display("Response bundle", sizeof(mc_resp_bundle));
   27     display("Response objects per bundle", MAX_RESP_PER_BUNDLE);
   28 
   29     printf("----------------------------------------\n");
   30 
   31     display("libevent thread cumulative", sizeof(LIBEVENT_THREAD));
   32     display("Thread stats cumulative\t", sizeof(struct thread_stats));
   33 
   34     return 0;
   35 }