diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-02-11 00:56:03 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2021-03-25 22:21:06 -0700 |
commit | e63232e82d2355966d4a2eda523d7f51b760a805 (patch) | |
tree | cf8be0fcdb85e8237f1afac980188d891a29b5c4 /pk/boot.h | |
parent | 108c414a7730e9666a787d1bc55229d5cb07f7ce (diff) | |
download | pk-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.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |