Reputation: 403
When I try to compile any Nim file with --os:any
I get this error:
osalloc.nim(218, 10) Error: Port memory manager to your platform
Why does this error pop up and how can I fix it?
In addition, when I try to compile with -d:useMalloc
and --mm:orc/arc/none
it does work. However, it only works for files that don't import the os
module. How do I compile with --os:any
even with the os
module imported?
Upvotes: 3
Views: 340
Reputation: 173
--os:any
basically means: no OS support. It is generally used for writing kernels or bare metal microcontroller code where no OS is available. Therefore, it it expected that the os
module, which provides access to OS services, is not available for os:any
.
Furthermore, Nim uses a custom memory allocator. If it is not implemented for your platform (such as os:any
), you can ask nim to use the platform's malloc
if is available by passing -d:useMalloc
to the nim compiler.
Upvotes: 4