Skip to content

Commit

Permalink
add mm to compilesettings; deprecate gc (nim-lang#19394)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored and PMunch committed Mar 28, 2022
1 parent 7cee437 commit 927b9fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions compiler/vmops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ when defined(nimHasInvariant):
of backend: result = $conf.backend
of libPath: result = conf.libpath.string
of gc: result = $conf.selectedGC
of mm: result = $conf.selectedGC

proc querySettingSeqImpl(conf: ConfigRef, switch: BiggestInt): seq[string] =
template copySeq(field: untyped): untyped =
Expand Down
3 changes: 2 additions & 1 deletion lib/std/compilesettings.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ type
backend ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`
## and `nim js` would imply backend=js
libPath ## the absolute path to the stdlib library, i.e. nim's `--lib`, since 1.5.1
gc ## gc selected
gc {.deprecated.} ## gc selected
mm ## memory management selected

MultipleValueSetting* {.pure.} = enum ## \
## settings resulting in a seq of string values
Expand Down
3 changes: 2 additions & 1 deletion tests/vm/tcompilesetting.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
discard """
cmd: "nim c --nimcache:build/myNimCache --nimblePath:myNimblePath $file"
cmd: "nim c --nimcache:build/myNimCache --nimblePath:myNimblePath --gc:arc $file"
joinable: false
"""

Expand All @@ -12,6 +12,7 @@ template main =
doAssert "myNimblePath" in nimblePaths.querySettingSeq[0]
doAssert querySetting(backend) == "c"
doAssert fileExists(libPath.querySetting / "system.nim")
doAssert querySetting(mm) == "arc"

static: main()
main()

0 comments on commit 927b9fa

Please sign in to comment.