summaryrefslogtreecommitdiff
path: root/transient_heap.c
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2021-12-06 11:26:05 +0900
committerKoichi Sasada <ko1@atdot.net>2021-12-10 17:15:17 +0900
commit787daea6d2199c34d951aa3de0f3048829a8ea13 (patch)
tree09bb3e352979135bd7c28856a7d7117a358b24ac /transient_heap.c
parent0cefc2fbdf43778c76dbfce809dce46b3da95e27 (diff)
downloadruby-787daea6d2199c34d951aa3de0f3048829a8ea13.tar.gz
Allow configuring TRANSIENT_HEAP_TOTAL_SIZE
Some platforms have memory resource limits, but theap's memory area is too large for such situations. So allow configuring the size at build-time.
Diffstat (limited to 'transient_heap.c')
-rw-r--r--transient_heap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/transient_heap.c b/transient_heap.c
index d2cf8e4bd9..c14cf14613 100644
--- a/transient_heap.c
+++ b/transient_heap.c
@@ -59,7 +59,9 @@
/* K M */
#define TRANSIENT_HEAP_BLOCK_SIZE (1024 * 32 ) /* 32KB int16_t */
+#ifndef TRANSIENT_HEAP_TOTAL_SIZE
#define TRANSIENT_HEAP_TOTAL_SIZE (1024 * 1024 * 32) /* 32 MB */
+#endif
#define TRANSIENT_HEAP_ALLOC_MAX (1024 * 2 ) /* 2 KB */
#define TRANSIENT_HEAP_BLOCK_NUM (TRANSIENT_HEAP_TOTAL_SIZE / TRANSIENT_HEAP_BLOCK_SIZE)
#define TRANSIENT_HEAP_USABLE_SIZE (TRANSIENT_HEAP_BLOCK_SIZE - sizeof(struct transient_heap_block_header))