aboutsummaryrefslogtreecommitdiff
path: root/pk/boot.h
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2021-02-11 00:56:03 -0800
committerAndrew Waterman <andrew@sifive.com>2021-03-25 22:21:06 -0700
commite63232e82d2355966d4a2eda523d7f51b760a805 (patch)
treecf8be0fcdb85e8237f1afac980188d891a29b5c4 /pk/boot.h
parent108c414a7730e9666a787d1bc55229d5cb07f7ce (diff)
downloadpk-e63232e82d2355966d4a2eda523d7f51b760a805.zip
pk-e63232e82d2355966d4a2eda523d7f51b760a805.tar.gz
pk-e63232e82d2355966d4a2eda523d7f51b760a805.tar.bz2
pk: avoid out-of-memory errors
Estimate available memory and return -1 from mmap if not enough is available, rather than assert-failing.
Diffstat (limited to 'pk/boot.h')
-rw-r--r--pk/boot.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pk/boot.h b/pk/boot.h
index f8bc51c..3ba5a45 100644
--- a/pk/boot.h
+++ b/pk/boot.h
@@ -20,6 +20,7 @@ typedef struct {
size_t brk_max;
size_t mmap_max;
size_t stack_top;
+ size_t vm_alloc_guess;
uint64_t time0;
uint64_t cycle0;
uint64_t instret0;