]> git.proxmox.com Git - rustc.git/blobdiff - src/jemalloc/include/jemalloc/internal/stats.h
Imported Upstream version 1.8.0+dfsg1
[rustc.git] / src / jemalloc / include / jemalloc / internal / stats.h
index c91dba99dbe26a85368cdb7a35fb51dceca64644..ce96476ad75d558125683118a4aca4cc812c94bd 100644 (file)
@@ -4,7 +4,6 @@
 typedef struct tcache_bin_stats_s tcache_bin_stats_t;
 typedef struct malloc_bin_stats_s malloc_bin_stats_t;
 typedef struct malloc_large_stats_s malloc_large_stats_t;
-typedef struct malloc_huge_stats_s malloc_huge_stats_t;
 typedef struct arena_stats_s arena_stats_t;
 typedef struct chunk_stats_s chunk_stats_t;
 
@@ -21,6 +20,12 @@ struct tcache_bin_stats_s {
 };
 
 struct malloc_bin_stats_s {
+       /*
+        * Current number of bytes allocated, including objects currently
+        * cached by tcache.
+        */
+       size_t          allocated;
+
        /*
         * Total number of allocation/deallocation requests served directly by
         * the bin.  Note that tcache may allocate an object, then recycle it
@@ -37,12 +42,6 @@ struct malloc_bin_stats_s {
         */
        uint64_t        nrequests;
 
-       /*
-        * Current number of regions of this size class, including regions
-        * currently cached by tcache.
-        */
-       size_t          curregs;
-
        /* Number of tcache fills from this bin. */
        uint64_t        nfills;
 
@@ -79,25 +78,10 @@ struct malloc_large_stats_s {
         */
        uint64_t        nrequests;
 
-       /*
-        * Current number of runs of this size class, including runs currently
-        * cached by tcache.
-        */
+       /* Current number of runs of this size class. */
        size_t          curruns;
 };
 
-struct malloc_huge_stats_s {
-       /*
-        * Total number of allocation/deallocation requests served directly by
-        * the arena.
-        */
-       uint64_t        nmalloc;
-       uint64_t        ndalloc;
-
-       /* Current number of (multi-)chunk allocations of this size class. */
-       size_t          curhchunks;
-};
-
 struct arena_stats_s {
        /* Number of bytes currently mapped. */
        size_t          mapped;
@@ -111,13 +95,6 @@ struct arena_stats_s {
        uint64_t        nmadvise;
        uint64_t        purged;
 
-       /*
-        * Number of bytes currently mapped purely for metadata purposes, and
-        * number of bytes currently allocated for internal metadata.
-        */
-       size_t          metadata_mapped;
-       size_t          metadata_allocated; /* Protected via atomic_*_z(). */
-
        /* Per-size-category statistics. */
        size_t          allocated_large;
        uint64_t        nmalloc_large;
@@ -127,12 +104,30 @@ struct arena_stats_s {
        size_t          allocated_huge;
        uint64_t        nmalloc_huge;
        uint64_t        ndalloc_huge;
+       uint64_t        nrequests_huge;
 
-       /* One element for each large size class. */
+       /*
+        * One element for each possible size class, including sizes that
+        * overlap with bin size classes.  This is necessary because ipalloc()
+        * sometimes has to use such large objects in order to assure proper
+        * alignment.
+        */
        malloc_large_stats_t    *lstats;
+};
+
+struct chunk_stats_s {
+       /* Number of chunks that were allocated. */
+       uint64_t        nchunks;
 
-       /* One element for each huge size class. */
-       malloc_huge_stats_t     *hstats;
+       /* High-water mark for number of chunks allocated. */
+       size_t          highchunks;
+
+       /*
+        * Current number of chunks allocated.  This value isn't maintained for
+        * any other purpose, so keep track of it in order to be able to set
+        * highchunks.
+        */
+       size_t          curchunks;
 };
 
 #endif /* JEMALLOC_H_STRUCTS */