core: Make arena size configurable.

* mes.c (main): Read MES_ARENA.
* scripts/repl.mes: Set MES_ARENA to 5000000 if not already set.
  Fixes repl startup.
This commit is contained in:
Jan Nieuwenhuizen 2016-12-11 08:50:51 +01:00
parent 0bdad95f61
commit 753b63818c
2 changed files with 4 additions and 0 deletions

2
mes.c
View File

@ -1241,6 +1241,8 @@ int
main (int argc, char *argv[])
{
g_debug = getenv ("MES_DEBUG");
if (getenv ("MES_ARENA"))
ARENA_SIZE = atoi (getenv ("MES_ARENA"));
if (argc > 1 && !strcmp (argv[1], "--dump")) g_dump_p = true;
if (argc > 1 && !strcmp (argv[1], "--help")) return puts ("Usage: mes < FILE\n");
if (argc > 1 && !strcmp (argv[1], "--version")) return puts ("Mes 0.2\n");

View File

@ -1,5 +1,7 @@
#! /bin/sh
# -*-scheme-*-
MES_ARENA=${MES_ARENA-5000000}
export MES_ARENA
cat $($(dirname $0)/include.mes $0) $0 /dev/stdin | $(dirname $0)/mes $MES_FLAGS "$@"
#paredit:|
exit $?