summary refs log tree commit diff stats
path: root/lib/system/arc.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-09 13:13:52 +0800
committerGitHub <noreply@github.com>2022-11-09 06:13:52 +0100
commitd8d08324d3f761fcef60433a1c35b97c4874be20 (patch)
treee5d061dc6f86b8a8433e9c58a622eda928c5a64a /lib/system/arc.nim
parentcdb136f58545009d2e38e5f1c4822bcc6dc7df83 (diff)
downloadNim-d8d08324d3f761fcef60433a1c35b97c4874be20.tar.gz
clean up `system/arc` (#20792)
Diffstat (limited to 'lib/system/arc.nim')
-rw-r--r--lib/system/arc.nim37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/system/arc.nim b/lib/system/arc.nim
index a8da0b6e3..d8527e1e4 100644
--- a/lib/system/arc.nim
+++ b/lib/system/arc.nim
@@ -12,26 +12,6 @@ In this new runtime we simplify the object layouts a bit: The runtime type
 information is only accessed for the objects that have it and it's always
 at offset 0 then. The ``ref`` object header is independent from the
 runtime type and only contains a reference count.
-
-Object subtyping is checked via the generated 'name'. This should have
-comparable overhead to the old pointer chasing approach but has the benefit
-that it works across DLL boundaries.
-
-The generated name is a concatenation of the object names in the hierarchy
-so that a subtype check becomes a substring check. For example::
-
-  type
-    ObjectA = object of RootObj
-    ObjectB = object of ObjectA
-
-ObjectA's ``name`` is "|ObjectA|RootObj|".
-ObjectB's ``name`` is "|ObjectB|ObjectA|RootObj|".
-
-Now to check for ``x of ObjectB`` we need to check
-for ``x.typ.name.endsWith("|ObjectB|ObjectA|RootObj|")``.
-In the actual implementation, however, we could also use a
-hash of ``package & "." & module & "." & name`` to save space.
-
 ]#
 
 when defined(gcOrc):
@@ -227,22 +207,5 @@ template tearDownForeignThreadGc* =
   ## With `--gc:arc` a nop.
   discard
 
-proc memcmp(str1, str2: cstring, n: csize_t): cint {.importc, header: "<string.h>".}
-
-func endsWith(s, suffix: cstring): bool {.inline.} =
-  let
-    sLen = s.len
-    suffixLen = suffix.len
-
-  if suffixLen <= sLen:
-    result = memcmp(cstring(addr s[sLen - suffixLen]), suffix, csize_t(suffixLen)) == 0
-
-proc isObj(obj: PNimTypeV2, subclass: cstring): bool {.compilerRtl, inl.} =
-  result = endsWith(obj.name, subclass)
-
 proc isObjDisplayCheck(source: PNimTypeV2, targetDepth: int16, token: uint32): bool {.compilerRtl, inline.} =
   result = targetDepth <= source.depth and source.display[targetDepth] == token
-
-proc chckObj(obj: PNimTypeV2, subclass: cstring) {.compilerRtl.} =
-  # checks if obj is of type subclass:
-  if not isObj(obj, subclass): sysFatal(ObjectConversionDefect, "invalid object conversion")