Added 'ansic' os support for minimal (embedded) targets (#13088)
* os:any implementation * os:asny: omit flock/funlock calls in echoBinSafe * Disabled default "unhandled expection" reporting for `--os:any` to reduce code size. Added unhandledExceptionHook instead which can be used to get a notification from Nim and handle it from the application.
This commit is contained in:
parent
d31e32743f
commit
79a326759a
6 changed files with 87 additions and 73 deletions
|
|
@ -295,5 +295,16 @@ elif hostOS == "standalone" or defined(StandaloneHeapSize):
|
|||
proc osDeallocPages(p: pointer, size: int) {.inline.} =
|
||||
if bumpPointer-size == cast[int](p):
|
||||
dec bumpPointer, size
|
||||
|
||||
elif hostOS == "any":
|
||||
proc osAllocPages(size: int): pointer {.inline.} =
|
||||
result = c_malloc(size.csize_t)
|
||||
|
||||
proc osTryAllocPages(size: int): pointer {.inline.} =
|
||||
result = c_malloc(size.csize_t)
|
||||
|
||||
proc osDeallocPages(p: pointer, size: int) {.inline.} =
|
||||
c_free(p)
|
||||
|
||||
else:
|
||||
{.error: "Port memory manager to your platform".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue