none.nim 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. when appType == "lib":
  2. {.warning: "nogc in a library context may not work".}
  3. include "system/alloc"
  4. proc initGC() = discard
  5. proc GC_disable() = discard
  6. proc GC_enable() = discard
  7. proc GC_fullCollect() = discard
  8. proc GC_setStrategy(strategy: GC_Strategy) = discard
  9. proc GC_enableMarkAndSweep() = discard
  10. proc GC_disableMarkAndSweep() = discard
  11. proc GC_getStatistics(): string = return ""
  12. proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} =
  13. result = alloc0Impl(size)
  14. proc newObjNoInit(typ: PNimType, size: int): pointer =
  15. result = alloc(size)
  16. {.push overflowChecks: on.}
  17. proc newSeq(typ: PNimType, len: int): pointer {.compilerproc.} =
  18. result = newObj(typ, align(GenericSeqSize, typ.align) + len * typ.base.size)
  19. cast[PGenericSeq](result).len = len
  20. cast[PGenericSeq](result).reserved = len
  21. {.pop.}
  22. proc growObj(old: pointer, newsize: int): pointer =
  23. result = realloc(old, newsize)
  24. proc nimGC_setStackBottom(theStackBottom: pointer) = discard
  25. proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
  26. proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
  27. proc unsureAsgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
  28. dest[] = src
  29. proc asgnRef(dest: PPointer, src: pointer) {.compilerproc, inline.} =
  30. dest[] = src
  31. proc asgnRefNoCycle(dest: PPointer, src: pointer) {.compilerproc, inline,
  32. deprecated: "old compiler compat".} = asgnRef(dest, src)
  33. var allocator {.rtlThreadVar.}: MemRegion
  34. instantiateForRegion(allocator)
  35. include "system/cellsets"