From 7ba2659f733b97db63b7552415ad048e34d4a11a Mon Sep 17 00:00:00 2001 From: Andrey Makarov Date: Thu, 28 Oct 2021 20:20:52 +0300 Subject: docgen: implement doc link resolution in current module (#18642) --- nimdoc/test_out_index_dot_html/expected/index.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nimdoc/test_out_index_dot_html/expected') diff --git a/nimdoc/test_out_index_dot_html/expected/index.html b/nimdoc/test_out_index_dot_html/expected/index.html index 3499b5326..69dd2eb2e 100644 --- a/nimdoc/test_out_index_dot_html/expected/index.html +++ b/nimdoc/test_out_index_dot_html/expected/index.html @@ -121,6 +121,8 @@ window.addEventListener('DOMContentLoaded', main);

Procs

+ +
proc foo() {....raises: [], tags: [].}
@@ -130,6 +132,8 @@ I do foo
+
+
-- cgit 1.4.1-2-gfad0 95be4576c3b9e3301709e8390'>tree commit diff stats
path: root/lib/system/gc_hooks.nim
blob: 70f02e6574a44c0d6f341f7f20ab23b8d5cd2884 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
#
#            Nim's Runtime Library
#        (c) Copyright 2019 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

## Hooks for memory management. Can be used to implement custom garbage
## collectors etc.

type
  GlobalMarkerProc = proc () {.nimcall, benign, raises: [], tags: [].}
var
  globalMarkersLen: int
  globalMarkers: array[0..3499, GlobalMarkerProc]
  threadLocalMarkersLen: int
  threadLocalMarkers: array[0..3499, GlobalMarkerProc]

proc nimRegisterGlobalMarker(markerProc: GlobalMarkerProc) {.compilerproc.} =
  if globalMarkersLen <= high(globalMarkers):
    globalMarkers[globalMarkersLen] = markerProc
    inc globalMarkersLen
  else:
    cstderr.rawWrite("[GC] cannot register global variable; too many global variables")
    quit 1

proc nimRegisterThreadLocalMarker(markerProc: GlobalMarkerProc) {.compilerproc.} =
  if threadLocalMarkersLen <= high(threadLocalMarkers):
    threadLocalMarkers[threadLocalMarkersLen] = markerProc
    inc threadLocalMarkersLen
  else:
    cstderr.rawWrite("[GC] cannot register thread local variable; too many thread local variables")
    quit 1

proc traverseGlobals*() =
  for i in 0..globalMarkersLen-1:
    globalMarkers[i]()

proc traverseThreadLocals*() =
  for i in 0..threadLocalMarkersLen-1:
    threadLocalMarkers[i]()

var
  newObjHook*: proc (typ: PNimType, size: int): pointer {.nimcall, tags: [], raises: [], gcsafe.}
  traverseObjHook*: proc (p: pointer, op: int) {.nimcall, tags: [], raises: [], gcsafe.}

proc nimGCvisit(p: pointer, op: int) {.inl, compilerRtl.} =
  traverseObjHook(p, op)

proc newObj(typ: PNimType, size: int): pointer {.inl, compilerRtl.} =
  result = newObjHook(typ, size)