mirror of
https://github.com/status-im/NimYAML.git
synced 2025-02-04 23:45:08 +00:00
disable DOM API when using ARC (ref #85)
This commit is contained in:
parent
1346467b42
commit
d20707c4e4
@ -4,4 +4,8 @@
|
|||||||
# See the file "copying.txt", included in this
|
# See the file "copying.txt", included in this
|
||||||
# distribution, for details about the copyright.
|
# distribution, for details about the copyright.
|
||||||
|
|
||||||
import tlex, tjson, tserialization, tdom, tparser, tquickstart, tannotations
|
|
||||||
|
import tlex, tjson, tserialization, tparser, tquickstart, tannotations
|
||||||
|
|
||||||
|
when not defined(gcArc) or defined(gcOrc):
|
||||||
|
import tdom
|
10
yaml.nim
10
yaml.nim
@ -38,8 +38,14 @@
|
|||||||
## * The hints API in `hints <yaml.hints.html>`_ provides a simple proc for
|
## * The hints API in `hints <yaml.hints.html>`_ provides a simple proc for
|
||||||
## guessing the type of a scalar value.
|
## guessing the type of a scalar value.
|
||||||
|
|
||||||
import yaml / [dom, hints, parser, presenter, annotations,
|
import yaml / [hints, parser, presenter, annotations,
|
||||||
serialization, stream, taglib, tojson]
|
serialization, stream, taglib, tojson]
|
||||||
|
|
||||||
export dom, hints, parser, presenter, annotations,
|
when not defined(gcArc) or defined(gcOrc):
|
||||||
|
# YAML DOM may contain cycles and therefore will leak memory if used with
|
||||||
|
# ARC but without ORC. In that case it won't be available.
|
||||||
|
import yaml/dom
|
||||||
|
export dom
|
||||||
|
|
||||||
|
export hints, parser, presenter, annotations,
|
||||||
serialization, stream, taglib, tojson
|
serialization, stream, taglib, tojson
|
||||||
|
@ -23,6 +23,9 @@ import tables, streams, hashes, sets, strutils
|
|||||||
import data, stream, taglib, serialization, private/internal, parser,
|
import data, stream, taglib, serialization, private/internal, parser,
|
||||||
presenter
|
presenter
|
||||||
|
|
||||||
|
when defined(gcArc) and not defined(gcOrc):
|
||||||
|
{.error: "NimYAML's DOM API only supports ORC because ARC can't deal with cycles".}
|
||||||
|
|
||||||
when defined(nimNoNil):
|
when defined(nimNoNil):
|
||||||
{.experimental: "notnil".}
|
{.experimental: "notnil".}
|
||||||
type
|
type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user