'lock levels' are deprecated, now a noop (#20539)
* 'lock levels' are deprecated, now a noop * fixes tests
This commit is contained in:
parent
7587371554
commit
5602183234
57 changed files with 121 additions and 372 deletions
|
|
@ -148,7 +148,7 @@ proc thinout*[T](x: ref T) {.inline.} =
|
|||
## and thus would keep the graph from being freed are `nil`'ed.
|
||||
## This is a form of cycle collection that works well with Nim's ARC
|
||||
## and its associated cost model.
|
||||
proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect, locks: 0.}
|
||||
proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect.}
|
||||
|
||||
breakCycles(head(cast[pointer](x)), getDynamicTypeInfo(x[]))
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ else:
|
|||
{.pragma: inl, inline.}
|
||||
{.pragma: compilerRtl, compilerproc.}
|
||||
|
||||
{.pragma: benign, gcsafe, locks: 0.}
|
||||
{.pragma: benign, gcsafe.}
|
||||
|
||||
when defined(nimHasSinkInference):
|
||||
{.push sinkInference: on.}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
when notJSnotNims:
|
||||
proc zeroMem*(p: pointer, size: Natural) {.inline, noSideEffect,
|
||||
tags: [], locks: 0, raises: [].}
|
||||
tags: [], raises: [].}
|
||||
## Overwrites the contents of the memory at `p` with the value 0.
|
||||
##
|
||||
## Exactly `size` bytes will be overwritten. Like any procedure
|
||||
## dealing with raw memory this is **unsafe**.
|
||||
|
||||
proc copyMem*(dest, source: pointer, size: Natural) {.inline, benign,
|
||||
tags: [], locks: 0, raises: [].}
|
||||
tags: [], raises: [].}
|
||||
## Copies the contents from the memory at `source` to the memory
|
||||
## at `dest`.
|
||||
## Exactly `size` bytes will be copied. The memory
|
||||
|
|
@ -15,7 +15,7 @@ when notJSnotNims:
|
|||
## memory this is **unsafe**.
|
||||
|
||||
proc moveMem*(dest, source: pointer, size: Natural) {.inline, benign,
|
||||
tags: [], locks: 0, raises: [].}
|
||||
tags: [], raises: [].}
|
||||
## Copies the contents from the memory at `source` to the memory
|
||||
## at `dest`.
|
||||
##
|
||||
|
|
@ -25,7 +25,7 @@ when notJSnotNims:
|
|||
## dealing with raw memory this is still **unsafe**, though.
|
||||
|
||||
proc equalMem*(a, b: pointer, size: Natural): bool {.inline, noSideEffect,
|
||||
tags: [], locks: 0, raises: [].}
|
||||
tags: [], raises: [].}
|
||||
## Compares the memory blocks `a` and `b`. `size` bytes will
|
||||
## be compared.
|
||||
##
|
||||
|
|
@ -34,7 +34,7 @@ when notJSnotNims:
|
|||
## **unsafe**.
|
||||
|
||||
proc cmpMem*(a, b: pointer, size: Natural): int {.inline, noSideEffect,
|
||||
tags: [], locks: 0, raises: [].}
|
||||
tags: [], raises: [].}
|
||||
## Compares the memory blocks `a` and `b`. `size` bytes will
|
||||
## be compared.
|
||||
##
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ type
|
|||
count*: int
|
||||
disabled: bool
|
||||
data*: array[400, LogEntry]
|
||||
TrackLogger* = proc (log: TrackLog) {.nimcall, tags: [], locks: 0, gcsafe.}
|
||||
TrackLogger* = proc (log: TrackLog) {.nimcall, tags: [], gcsafe.}
|
||||
|
||||
var
|
||||
gLog*: TrackLog
|
||||
|
|
@ -70,7 +70,7 @@ proc addEntry(entry: LogEntry) =
|
|||
if interesting:
|
||||
gLog.disabled = true
|
||||
cprintf("interesting %s:%ld %s\n", entry.file, entry.line, entry.op)
|
||||
let x = cast[proc() {.nimcall, tags: [], gcsafe, locks: 0, raises: [].}](writeStackTrace)
|
||||
let x = cast[proc() {.nimcall, tags: [], gcsafe, raises: [].}](writeStackTrace)
|
||||
x()
|
||||
quit 1
|
||||
#if gLog.count > high(gLog.data):
|
||||
|
|
@ -85,7 +85,7 @@ proc memTrackerWrite(address: pointer; size: int; file: cstring; line: int) {.co
|
|||
size: size, file: file, line: line, thread: myThreadId())
|
||||
|
||||
proc memTrackerOp*(op: cstring; address: pointer; size: int) {.tags: [],
|
||||
locks: 0, gcsafe.} =
|
||||
gcsafe.} =
|
||||
addEntry LogEntry(op: op, address: address, size: size,
|
||||
file: "", line: 0, thread: myThreadId())
|
||||
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ proc captureStackTrace(f: PFrame, st: var StackTrace) =
|
|||
b = b.prev
|
||||
|
||||
var
|
||||
profilingRequestedHook*: proc (): bool {.nimcall, locks: 0, gcsafe.}
|
||||
profilingRequestedHook*: proc (): bool {.nimcall, gcsafe.}
|
||||
## set this variable to provide a procedure that implements a profiler in
|
||||
## user space. See the `nimprof` module for a reference implementation.
|
||||
|
||||
when defined(memProfiler):
|
||||
type
|
||||
MemProfilerHook* = proc (st: StackTrace, requestedSize: int) {.nimcall, locks: 0, gcsafe.}
|
||||
MemProfilerHook* = proc (st: StackTrace, requestedSize: int) {.nimcall, gcsafe.}
|
||||
|
||||
var
|
||||
profilerHook*: MemProfilerHook
|
||||
|
|
|
|||
|
|
@ -22,26 +22,26 @@ when defined(nimStackTraceOverride):
|
|||
## This is the same as the type `uintptr_t` in C.
|
||||
|
||||
StackTraceOverrideGetTracebackProc* = proc (): string {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
nimcall, gcsafe, raises: [], tags: [], noinline.}
|
||||
StackTraceOverrideGetProgramCountersProc* = proc (maxLength: cint): seq[cuintptr_t] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
nimcall, gcsafe, raises: [], tags: [], noinline.}
|
||||
StackTraceOverrideGetDebuggingInfoProc* =
|
||||
proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
nimcall, gcsafe, raises: [], tags: [], noinline.}
|
||||
|
||||
# Default procedures (not normally used, because people opting in on this
|
||||
# override are supposed to register their own versions).
|
||||
var
|
||||
stackTraceOverrideGetTraceback: StackTraceOverrideGetTracebackProc =
|
||||
proc (): string {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
proc (): string {.nimcall, gcsafe, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
#result = "Stack trace override procedure not registered.\n"
|
||||
stackTraceOverrideGetProgramCounters: StackTraceOverrideGetProgramCountersProc =
|
||||
proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
stackTraceOverrideGetDebuggingInfo: StackTraceOverrideGetDebuggingInfoProc =
|
||||
proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
nimcall, gcsafe, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
|
||||
# Custom procedure registration.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue