bin_stats.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef JEMALLOC_INTERNAL_BIN_STATS_H
  2. #define JEMALLOC_INTERNAL_BIN_STATS_H
  3. #include "jemalloc/internal/mutex_prof.h"
  4. typedef struct bin_stats_s bin_stats_t;
  5. struct bin_stats_s {
  6. /*
  7. * Total number of allocation/deallocation requests served directly by
  8. * the bin. Note that tcache may allocate an object, then recycle it
  9. * many times, resulting many increments to nrequests, but only one
  10. * each to nmalloc and ndalloc.
  11. */
  12. uint64_t nmalloc;
  13. uint64_t ndalloc;
  14. /*
  15. * Number of allocation requests that correspond to the size of this
  16. * bin. This includes requests served by tcache, though tcache only
  17. * periodically merges into this counter.
  18. */
  19. uint64_t nrequests;
  20. /*
  21. * Current number of regions of this size class, including regions
  22. * currently cached by tcache.
  23. */
  24. size_t curregs;
  25. /* Number of tcache fills from this bin. */
  26. uint64_t nfills;
  27. /* Number of tcache flushes to this bin. */
  28. uint64_t nflushes;
  29. /* Total number of slabs created for this bin's size class. */
  30. uint64_t nslabs;
  31. /*
  32. * Total number of slabs reused by extracting them from the slabs heap
  33. * for this bin's size class.
  34. */
  35. uint64_t reslabs;
  36. /* Current number of slabs in this bin. */
  37. size_t curslabs;
  38. /* Current size of nonfull slabs heap in this bin. */
  39. size_t nonfull_slabs;
  40. };
  41. typedef struct bin_stats_data_s bin_stats_data_t;
  42. struct bin_stats_data_s {
  43. bin_stats_t stats_data;
  44. mutex_prof_data_t mutex_data;
  45. };
  46. #endif /* JEMALLOC_INTERNAL_BIN_STATS_H */