Skip to content

Commit a544adf

Browse files
committed
runtime: adjust default heap size
1 parent f515e55 commit a544adf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

runtime/include/alaska/Heap.hpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ namespace alaska {
3333
// we will split it up into different mmap regions, but that's
3434
// just a problem solved by another layer of allocators.
3535

36+
37+
#ifndef HEAP_SIZE_SHIFT_FACTOR
38+
#define HEAP_SIZE_SHIFT_FACTOR 33
39+
#endif
3640
#ifdef ALASKA_TRACK_VALGRIND
3741
static constexpr uint64_t heap_size_shift_factor = 33;
3842
#else
39-
static constexpr uint64_t heap_size_shift_factor = 37;
43+
static constexpr uint64_t heap_size_shift_factor = HEAP_SIZE_SHIFT_FACTOR;
4044
#endif
4145

4246
static constexpr size_t heap_size = 1LU << heap_size_shift_factor;
@@ -60,6 +64,11 @@ namespace alaska {
6064
void *get_start(void) const { return heap; }
6165

6266

67+
double get_usage_frac(void) const {
68+
return 100.0 * (alloc_count / (double)(heap_size / page_size));
69+
}
70+
71+
6372
inline uint64_t get_allocated_page_count(void) const { return alloc_count; }
6473

6574
private:

0 commit comments

Comments
 (0)