Coverage / crates/oxy-core/src/alloc_stats.rs 17.4%
8 of 46 lines run, 2 of 16 functions · run #401 on subrepo-pin-state · run missed
| 1 | //! A counting allocator for measuring memory (`--features alloc-stats` on | |
| 2 | //! the `oxy` binary, with `OXY_TIMINGS=1`): each timing phase then also | |
| 3 | //! reports live bytes, the peak so far and what the phase allocated, so a | |
| 4 | //! profile names the structure that holds the memory. | |
| 5 | | |
| 6 | use ; | |
| 7 | use ; | |
| 8 | ||
| 9 | static LIVE: AtomicUsize = new; | |
| 10 | static PEAK: AtomicUsize = new; | |
| 11 | static TOTAL: AtomicUsize = new; | |
| 12 | static COUNT: AtomicUsize = new; | |
| 13 | static ACTIVE: AtomicBool = new; | |
| 14 | ||
| 15 | /// The system allocator, counting. Install it with | |
| 16 | /// `#[global_allocator] static A: Counting = Counting;`. | |
| 17 | ; | |
| 18 | ||
| 19 | | |
| 20 | 0× | |
| 21 | 0× | |
| 22 | 0× | |
| 23 | 0× | |
| 24 | 0× | |
| 25 | 0× | |
| 26 | 0× | |
| 27 | | |
| 28 | ||
| 29 | unsafe | |
| 30 | 0× | |
| 31 | 0× | |
| 32 | 0× | |
| 33 | 0× | |
| 34 | 0× | |
| 35 | 0× | |
| 36 | 0× | |
| 37 | 0× | |
| 38 | 0× | |
| 39 | 0× | |
| 40 | 0× | |
| 41 | 0× | |
| 42 | 0× | |
| 43 | 0× | |
| 44 | 0× | |
| 45 | 0× | |
| 46 | 0× | |
| 47 | 0× | |
| 48 | 0× | |
| 49 | 0× | |
| 50 | 0× | |
| 51 | 0× | |
| 52 | 0× | |
| 53 | 0× | |
| 54 | 0× | |
| 55 | 0× | |
| 56 | | |
| 57 | ||
| 58 | /// What the counting allocator has seen, when it is installed. | |
| 59 | | |
| 60 | | |
| 61 | | |
| 62 | | |
| 63 | | |
| 64 | | |
| 65 | | |
| 66 | | |
| 67 | | |
| 68 | | |
| 69 | | |
| 70 | ||
| 71 | /// The counters, or `None` when the counting allocator is not installed. | |
| 72 | 314× | |
| 73 | 314× | |
| 74 | 0× | |
| 75 | 0× | |
| 76 | 0× | |
| 77 | 0× | |
| 78 | 0× | |
| 79 | 314× | |
| 80 | ||
| 81 | /// Give pages the program has freed back to the system. glibc keeps freed | |
| 82 | /// memory in each thread's arena; after a large merge renders thousands of | |
| 83 | /// files on many threads, that kept memory is most of the process's size | |
| 84 | /// (#25). Elsewhere it does nothing. | |
| 85 | 24× | |
| 86 | | |
| 87 | | |
| 88 | | |
| 89 | 24× | |
| 90 | 24× | |
| 91 | 24× | |
| 92 | 24× | |