summary refs log tree commit diff stats
path: root/lib/system
Commit message (Collapse)AuthorAgeFilesLines
* move assertions out of system (#19599)flywind2022-03-235-115/+11
|
* system: thread: stack dealloction on Zephyr (#19633) [backport:1.6]Jaremy Creechley2022-03-221-2/+16
| | | Try to free the stack allocation when a thread exits. Possibly works for FreeRTOS as well.
* Update chcks.nim (#19540)rockcavera2022-02-171-1/+1
|
* fix #16458; make useNimRtl compile for --gc:orc (#19512)flywind2022-02-113-5/+7
| | | | | * fix #16458; make useNimRtl compile for --gc:orc/arc * fix tests
* move io out of system (#19442)flywind2022-02-021-963/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* added filemode docs (#19346)Smarcy2022-01-091-1/+4
|
* suggestion to respect typedarray type (#19257)Sven Keller2021-12-161-1/+27
| | | | | | | * suggestion to respect typedarray * Update jssys.nim Co-authored-by: Sven Keller <s.keller@cortona.de>
* nimRawSetjmp: support Windows (#19197)Ștefan Talpalaru2021-12-101-7/+39
| | | | | | | | | | | | * nimRawSetjmp: support Windows Using `_setjmp()` directly is required to avoid some rare (but very annoying) exception-related stack corruption leading to segfaults on Windows, with Mingw-w64 and SEH. More details: https://github.com/status-im/nimbus-eth2/issues/3121 Also add "nimBuiltinSetjmp" - mostly for benchmarking. * fix for Apple's Clang++
* Add support for LoongArch (#19223)wenghongquan2021-12-091-1/+3
| | | | | | | * Add support for LoongArch * Update compiler/installer.ini Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Atomic inc/dec should use ATOMIC_SEQ_CST (#19212)flywind2021-12-081-3/+3
|
* Making TCC work again on Windows --cpu:amd64 - fix #16326 (#19221)rockcavera2021-12-081-2/+16
| | | | | * fix #16326 * removing comments
* remove `sysspawn` which is dead code (#19218)flywind2021-12-061-187/+0
|
* [format minor] remove unnecessary spaces (#19216)flywind2021-12-061-5/+5
|
* make JS trunc polyfill opt-in, closes #16144 (#19183)hlaaftana2021-11-241-3/+3
|
* Implement threads on Zephyr (#19156)Jaremy Creechley2021-11-232-9/+27
| | | | | | | | | | | | | | | | | | | * pthreads setup for zephyr - enable tweak stack size - update lib/system/threads.nim - Fix int/uint in casting pointer. * add documentation and tweak flag names * add documentation and tweak flag names * fix configuration flag names * fix configuration flag names * cleanup Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Enable customizing PageShift to set PageSize for embedded targets (#19129)Jaremy Creechley2021-11-161-3/+7
| | | | | | | | | | | | | | | | * Enable customizing PageSize (via PageShift). This enables adjusting PageSize for embedded targets without abusing cpu16. * copy nimPageXYZ settings for mmpaptest * add docs for Nim manual * add docs for Nim manual * docs tweaks Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* fixes .raises inference for newSeq builtin under --gc:orc [backport] (#19158)Andreas Rumpf2021-11-161-1/+1
|
* wrong spaces (3 => 2) (#19145)flywind2021-11-141-1/+1
|
* refactoring: orc can use getThreadId() (#19123)Andreas Rumpf2021-11-114-96/+110
| | | | | * refactoring: orc can use getThreadId() * progress
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-072-6/+9
| | | | * fixes another effect inference bug [backport:1.6]
* fixes #19000 (#19032)Andreas Rumpf2021-10-301-0/+6
| | | | | * fixes #19000 * progress
* Freeing critical sections via atexit in system/alloc and system/io (#19062)Tail Wag Games2021-10-292-4/+7
| | | | | | | | | | | | | | | * adding new system module sysexitprocs and including system exit procedures when registering exit handlers defined in userland * fixing failing tests and adding initialization guard to handle cases where the module's global init logic isn't invoked first as is the case with some gc implementaions * js backend shouldn't try to invoke actual system exit procs * fixing formatting in sysexitprocs.nim * 256 was too much - my max number of plugins in my engine is 64 and I require two hooks per runtime it looks like with tls emulation turned off, so for my purposes 128 should be sufficient * so atExit should be enough here, can get rid of all the extra cruft I had added on top since I didn't realize atExit already provided a stack * done being cute - since newruntime prevents correct cpp codegen for object variants apparently and breaks tests if I try to use std/exitprocs, ddSysExitProc is just going into both modules. Since system doesn't include system/io, polluting system with it doesn't make sense either... at least it is only importc'd when it is required in either module and we don't have to have any weird when defined(nimOwnedEnabled) with a comment explaining why
* deinitializing locks at program exit (#19043)Tail Wag Games2021-10-251-24/+32
| | | | | | | | | | | | * deinitializing locks at program exit * deinitLock shouldn't be called for js backend I guess... * I suppose this is the best way to detect the ewruntime option * I guess I need these guards here too... * fixing merge conflict
* Add Zephyr Support (#19003)Jaremy Creechley2021-10-245-15/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Remerge * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * fix maxDescriptors on zephyr/freertos * move maxDescriptors to selector.nim -- fixes compile issue * change realloc impl on zephyr to match ansi c behavior * change realloc impl on zephyr to match ansi c behavior * force compileOnly mode for tlwip Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com> Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Add Elbrus 2000 architecture (#19024)Danil Yarantsev2021-10-211-1/+3
| | | | | | | | | * Add Elbrus 2000 architecture * Add e2k to niminst * Update compiler/installer.ini Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Removes deprecated {.injectStmt.}. Fixes #18666 (#18984)Dominik Picheta2021-10-131-10/+0
|
* fix code-block which causes missing docsflywind2021-09-111-2/+2
|
* fix for js strict mode (#18799)Sven Keller2021-09-041-4/+1
| | | | | | | | * Assignments, which would accidentally create global variables, instead throw an error in strict mode * Assignment to a getter-only property Co-authored-by: Sven Keller <s.keller@cortona.de>
* fixes #18494 (#18783)Andreas Rumpf2021-09-021-8/+34
|
* strict effects (#18777)Andreas Rumpf2021-09-022-4/+4
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* improvements to `addInt` and `$` for integer types (#18592)Timothee Cour2021-08-194-79/+35
| | | | | | | | * improvements to $(SomeInteger) and addInt * remove mIntToStr, mInt64ToStr * improvements * fix tests/pragmas/tinjectstmt.nim; the diff is harmless, cgen code is identical with -d:danger or debug mode * rm tests/system/tstrmantle.nim * revert compiler/jsgen.nim for -d:nimVersion140
* fix #18702(fix `parseutils.parseFloat`) (#18703) [backport:1.0]flywind2021-08-161-4/+5
| | | | | * fix #18702 * Apply suggestions from code review
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + ↵Timothee Cour2021-08-137-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lineinfo, in all backends (c,vm,js) (#11955) * fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
* Switch maintanance (#18668)RSDuck2021-08-111-111/+0
| | | | | | | | | * Fix and improve Nintendo Switch support * Document the necessity for nimAllocPagesViaMalloc * update changelog * Use --gc:orc in examples
* Add optional recursive arg to distinctBase (v2) (#18659)Timothee Cour2021-08-091-1/+1
| | | | | | * Add optional recursive arg to distinctBase * Add docs and examples Co-authored-by: ALANVF <alan.invents@gmail.com>
* renamed: lib/std/private/vmutils.nim -> lib/std/private/bitops_utils.nim ↵Timothee Cour2021-08-081-1/+1
| | | | to avoid confusion with unrelated std/vmutils (#18660)
* use lent (#18638)flywind2021-08-081-2/+2
|
* fix #18620 (#18624)flywind2021-08-011-4/+1
| | | | | * fix #18620 * add testcase
* various small documentation improvements (#18602)Miran2021-07-281-1/+1
|
* fixes #18579 (#18600)Andreas Rumpf2021-07-271-4/+2
|
* rename nimFpRoundtrips => nimPreviewFloatRoundtrip (#18566)Timothee Cour2021-07-231-2/+2
|
* fixes #18550 (#18553)Andreas Rumpf2021-07-212-5/+5
| | | | | * fixes #18550 * update the manual to reflect reality
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-205-118/+126
| | | | | | * compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
* use .} instead of } for code highlightersAraq2021-07-201-2/+2
|
* make dragonbox opt-in via -d:nimFpRoundtrips (#18504)Andreas Rumpf2021-07-162-2/+2
| | | | | | | * make dragonbox opt-in via -d:nimFpRoundtrips * make tests green again * make tests green again
* added `nimAllocPagesViaMalloc` switch (#18490)Andreas Rumpf2021-07-152-5/+29
| | | | | * added switch * alloc.nim needs page aligned memory blocks
* Revert "Make 'echo' raise IOErrors when appropriate (#16367)" (#18460)Miran2021-07-081-16/+8
| | | This reverts commit 23d23ecb081be6702d74024be8f96d92d9f88a59.
* ORC: use =destroy instead of =dispose (#18440)Andreas Rumpf2021-07-073-32/+37
| | | | | | * ORC refactoring in preparation for further changes (=dispose must die) * ORC: embrace =destroy, avoid =dispose * ORC: no need for =dispose * closes #18421
* fixes #18411 (#18432) [backport:1.4]Andreas Rumpf2021-07-051-3/+1
|
* don't use `{.rtl.}` for generics, otherwise `-d:useNimRtl` gives `ambiguous ↵Timothee Cour2021-07-011-6/+7
| | | | identifier` nimrtl error (#18406)