diff --git a/doc/advopt.txt b/doc/advopt.txt index 6665ce5375..9b7f29a5e5 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -146,8 +146,6 @@ Advanced options: --legacy:$2 enable obsolete/legacy language feature --useVersion:1.0 emulate Nim version X of the Nim compiler - --newruntime use an alternative runtime that uses destructors - and that uses a shared heap via -d:useMalloc --profiler:on|off enable profiling; requires `import nimprof`, and works better with `--stackTrace:on` see also https://nim-lang.github.io/Nim/estp.html diff --git a/doc/destructors.rst b/doc/destructors.rst index 6cab6e1d26..c97b17d6f7 100644 --- a/doc/destructors.rst +++ b/doc/destructors.rst @@ -534,48 +534,6 @@ indirections: useItAgain(v) - -Owned refs -========== - -**Note**: The ``owned`` type constructor is only available with -the ``--newruntime`` compiler switch and is experimental. - - -Let ``W`` be an ``owned ref`` type. Conceptually its hooks look like: - -.. code-block:: nim - - proc `=destroy`(x: var W) = - if x != nil: - assert x.refcount == 0, "dangling unowned pointers exist!" - `=destroy`(x[]) - - proc `=`(x: var W; y: W) {.error: "owned refs can only be moved".} - - proc `=sink`(x: var W; y: W) = - `=destroy`(x) - bitwiseCopy x, y # raw pointer copy - - -Let ``U`` be an unowned ``ref`` type. Conceptually its hooks look like: - -.. code-block:: nim - - proc `=destroy`(x: var U) = - if x != nil: - dec x.refcount - - proc `=`(x: var U; y: U) = - # Note: No need to check for self-assignments here. - if y != nil: inc y.refcount - if x != nil: dec x.refcount - bitwiseCopy x, y # raw pointer copy - - proc `=sink`(x: var U, y: U) {.error.} - # Note: Moves are not available. - - Hook lifting ============