forward type alignment information to seqs (#12430)
This commit is contained in:
parent
a8f030fea2
commit
4005f0d0e4
25 changed files with 152 additions and 114 deletions
|
|
@ -514,6 +514,7 @@ when not defined(js) and not defined(nimSeqsV2):
|
|||
len, reserved: int
|
||||
when defined(gogc):
|
||||
elemSize: int
|
||||
elemAlign: int
|
||||
PGenericSeq {.exportc.} = ptr TGenericSeq
|
||||
# len and space without counting the terminating zero:
|
||||
NimStringDesc {.compilerproc, final.} = object of TGenericSeq
|
||||
|
|
@ -1123,6 +1124,13 @@ elif hostOS != "standalone":
|
|||
var programResult* {.compilerproc, exportc: "nim_program_result".}: int
|
||||
## deprecated, prefer ``quit``
|
||||
|
||||
proc align(address, alignment: int): int =
|
||||
if alignment == 0: # Actually, this is illegal. This branch exists to actively
|
||||
# hide problems.
|
||||
result = address
|
||||
else:
|
||||
result = (address + (alignment - 1)) and not (alignment - 1)
|
||||
|
||||
when defined(nimdoc):
|
||||
proc quit*(errorcode: int = QuitSuccess) {.magic: "Exit", noreturn.}
|
||||
## Stops the program immediately with an exit code.
|
||||
|
|
@ -1698,6 +1706,7 @@ when not defined(js) and defined(nimV2):
|
|||
TNimType {.compilerproc.} = object
|
||||
destructor: pointer
|
||||
size: int
|
||||
align: int
|
||||
name: cstring
|
||||
traceImpl: pointer
|
||||
disposeImpl: pointer
|
||||
|
|
@ -1709,7 +1718,6 @@ when notJSnotNims and defined(nimSeqsV2):
|
|||
|
||||
{.pop.}
|
||||
|
||||
|
||||
when notJSnotNims:
|
||||
proc writeStackTrace*() {.tags: [], gcsafe, raises: [].}
|
||||
## Writes the current stack trace to ``stderr``. This is only works
|
||||
|
|
@ -1988,8 +1996,8 @@ proc abs*(x: int64): int64 {.magic: "AbsI", noSideEffect.} =
|
|||
result = if x < 0: -x else: x
|
||||
{.pop.}
|
||||
|
||||
|
||||
when not defined(js):
|
||||
|
||||
proc likelyProc(val: bool): bool {.importc: "NIM_LIKELY", nodecl, noSideEffect.}
|
||||
proc unlikelyProc(val: bool): bool {.importc: "NIM_UNLIKELY", nodecl, noSideEffect.}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue