Minor additions/changes
This commit is contained in:
parent
11c8c0a5ab
commit
66cd6be0be
|
@ -31,7 +31,7 @@ when debugVM or debugMem or debugGC:
|
||||||
import std/terminal
|
import std/terminal
|
||||||
|
|
||||||
|
|
||||||
{.push checks:on.} # The VM is a critical point where checks are deleterious
|
{.push checks:not disableVMChecks.} # The VM is a critical point where checks are deleterious
|
||||||
|
|
||||||
type
|
type
|
||||||
PeonVM* = ref object
|
PeonVM* = ref object
|
||||||
|
@ -68,7 +68,7 @@ type
|
||||||
HeapObject* = object
|
HeapObject* = object
|
||||||
## A tagged box for a heap-allocated
|
## A tagged box for a heap-allocated
|
||||||
## peon object
|
## peon object
|
||||||
marked*: bool
|
marked*: bool # Used in the GC phase
|
||||||
case kind*: ObjectKind
|
case kind*: ObjectKind
|
||||||
of String:
|
of String:
|
||||||
str*: ptr UncheckedArray[char]
|
str*: ptr UncheckedArray[char]
|
||||||
|
|
|
@ -27,6 +27,7 @@ const debugStressGC* {.booldefine.} = false # Make the GC run a collection at
|
||||||
const PeonBytecodeMarker* = "PEON_BYTECODE" # Magic value at the beginning of bytecode files
|
const PeonBytecodeMarker* = "PEON_BYTECODE" # Magic value at the beginning of bytecode files
|
||||||
const HeapGrowFactor* = 2 # The growth factor used by the GC to schedule the next collection
|
const HeapGrowFactor* = 2 # The growth factor used by the GC to schedule the next collection
|
||||||
const FirstGC* = 1024 * 1024; # How many bytes to allocate before running the first GC
|
const FirstGC* = 1024 * 1024; # How many bytes to allocate before running the first GC
|
||||||
|
const disableVMChecks* {.booldefine.} = true; # Disables all types of compiler (nim-wise) checks in the VM
|
||||||
when HeapGrowFactor <= 1:
|
when HeapGrowFactor <= 1:
|
||||||
{.fatal: "Heap growth factor must be > 1".}
|
{.fatal: "Heap growth factor must be > 1".}
|
||||||
const PeonVersion* = (major: 0, minor: 1, patch: 0)
|
const PeonVersion* = (major: 0, minor: 1, patch: 0)
|
||||||
|
@ -35,8 +36,8 @@ const PeonCommitHash* = "058b021493577a45ff6418d8073008be401b5910"
|
||||||
when len(PeonCommitHash) != 40:
|
when len(PeonCommitHash) != 40:
|
||||||
{.fatal: "The git commit hash must be exactly 40 characters long".}
|
{.fatal: "The git commit hash must be exactly 40 characters long".}
|
||||||
const PeonBranch* = "master"
|
const PeonBranch* = "master"
|
||||||
when len(PeonBranch) > 255:
|
when len(PeonBranch) > 255 or len(PeonBranch) == 0:
|
||||||
{.fatal: "The git branch name's length must be less than or equal to 255 characters".}
|
{.fatal: "The git branch name's length must be within 1 and 255 characters".}
|
||||||
const PeonVersionString* = &"Peon {PeonVersion.major}.{PeonVersion.minor}.{PeonVersion.patch} {PeonRelease} ({PeonBranch}, {CompileDate}, {CompileTime}, {PeonCommitHash[0..8]}) [Nim {NimVersion}] on {hostOS} ({hostCPU})"
|
const PeonVersionString* = &"Peon {PeonVersion.major}.{PeonVersion.minor}.{PeonVersion.patch} {PeonRelease} ({PeonBranch}, {CompileDate}, {CompileTime}, {PeonCommitHash[0..8]}) [Nim {NimVersion}] on {hostOS} ({hostCPU})"
|
||||||
const HelpMessage* = """The peon programming language, Copyright (C) 2022 Mattia Giambirtone & All Contributors
|
const HelpMessage* = """The peon programming language, Copyright (C) 2022 Mattia Giambirtone & All Contributors
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue