Commit a544adf 1 parent f515e55 commit a544adf Copy full SHA for a544adf
File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,14 @@ namespace alaska {
33
33
// we will split it up into different mmap regions, but that's
34
34
// just a problem solved by another layer of allocators.
35
35
36
+
37
+ #ifndef HEAP_SIZE_SHIFT_FACTOR
38
+ #define HEAP_SIZE_SHIFT_FACTOR 33
39
+ #endif
36
40
#ifdef ALASKA_TRACK_VALGRIND
37
41
static constexpr uint64_t heap_size_shift_factor = 33 ;
38
42
#else
39
- static constexpr uint64_t heap_size_shift_factor = 37 ;
43
+ static constexpr uint64_t heap_size_shift_factor = HEAP_SIZE_SHIFT_FACTOR ;
40
44
#endif
41
45
42
46
static constexpr size_t heap_size = 1LU << heap_size_shift_factor;
@@ -60,6 +64,11 @@ namespace alaska {
60
64
void *get_start (void ) const { return heap; }
61
65
62
66
67
+ double get_usage_frac (void ) const {
68
+ return 100.0 * (alloc_count / (double )(heap_size / page_size));
69
+ }
70
+
71
+
63
72
inline uint64_t get_allocated_page_count (void ) const { return alloc_count; }
64
73
65
74
private:
You can’t perform that action at this time.
0 commit comments