summary refs log tree commit diff stats
path: root/lib/system
Commit message (Collapse)AuthorAgeFilesLines
* fix #17941: UnusedImport works for var/let/const/type invoked inside a ↵Timothee Cour2021-05-081-2/+1
| | | | | | | generic (#17942) * fix #17941: UnusedImport works for var/let/const/type invoked inside a generic * fixup
* fix #14873 properly by skipping `abi` field in importc type (#17944)Timothee Cour2021-05-071-8/+0
| | | | | | | * fix #14873 properly by skipping `abi` field in importc type * add test * fix test for windows
* remove unsused OsPlatform.nimVM (#17953)Timothee Cour2021-05-071-2/+1
|
* Fix C++ compilation error in excpt.nim (#17951)Danil Yarantsev2021-05-061-1/+1
|
* minor cleanups (#17948)Andreas Rumpf2021-05-061-1/+1
|
* system.nim cleanup some exported constants which should never have be… ↵Andreas Rumpf2021-05-014-3/+23
| | | | | | (#17909) * system.nim cleanup some exported constants which should never have been exported
* Ref #17831(synchapi.h: No such file or directory) (#17832)flywind2021-04-251-2/+1
| | | | | | | | | * Ref #17831 use windows.h * use header: "windows.h" * Update syslocks.nim * Update lib/system/syslocks.nim
* fix #17812 (repr fails to compile with ARC/ORC) (#17816)flywind2021-04-221-1/+1
|
* Rename `=` to `=copy` in stdlib (#17781)Clyybber2021-04-191-1/+1
|
* [std/locks]close #7998(complete condition variables) (#17711)flywind2021-04-193-43/+48
| | | | | | * close #7998 * workaround genode * Update lib/system/syslocks.nim
* fix #17749 ignore SIGPIPE signals, fix nim CI #17748 (#17752)Timothee Cour2021-04-181-3/+13
| | | | | * fix #17749 SIGPIPE * fix for windows
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-174-4/+4
| | | | cstring, not cString (#17744)
* make the copy operation of Thread an error (#17734)flywind2021-04-161-0/+2
|
* Remove the use of usrToCell in gcMark [backport:1.2] (#17709)zah2021-04-142-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove the use of usrToCell in gcMark [backport:1.2] Recently, we've discovered a GC crash resulting from inlining of the memory allocation procs that allowed the compiler to avoid maintaining any references to the "user pointer" on the stack. Instead, a "cell pointer" appeared there and all field accesses were performed with adjusted offsets. This interfered with the ability of the GC to mark the correct cell in the conservative stack scans which lead to premature collection of objects. More details here: https://github.com/status-im/Nim/commit/af69b3ceae16281efd45cbee4ce1bedd14282304 This commit closes another theoretical loophole that may lead to the same problem. If a short proc is accessing both the object and its reference count in a short sequence of instructions, the compiler may be enticed to reduce the number of registers being used by storing only a single pointer to the object and using offsets when reading and writing fields. A perfectly good strategy would be to store only the cell pointer, so the reference count updates can be performed without applying offsets. Accessing the fields of the object requires offsets anyway, but these can be adjusted at compile-time without any loss. Following this strategy will lead to the same problem of marking a wrong cell during the conservative stack scan, leading to premature collection. The problem is avoided by not using `usrToCell` in `gcMark`. Since the cell discovery logic can already handle interior pointers, the user pointers don't need to be adjusted for the GC to function correctly.
* Genode platform fixes (#17521)Emery Hemingway2021-04-091-6/+6
| | | | | | | | | | | | | | | | | | | * Genode: move dyncall failures to runtime Do not use the "error" pragma to warn that dynamic library loading is not implemented, print a message at runtime and exit. * Genode: use stricter dataspace type in page allocator * Genode: remove compiler configuration from nim.cfg Self-hosting Nim is not supported on Genode and defining the cross-compilation environment can be done externally. * Genode: use new mutex API * Genode: call nim_component_construct as a C procedure * Genode: implement echo for NimStringV2
* further progress on rst roles & directives (fix #17646) (#17659)Andrey Makarov2021-04-081-1/+1
| | | | | | | * further progress on rst roles & dir-s (fix #17646) * fix documents according to the messages * fix bug 17 from #17340
* fixes #17647 (#17667)Andreas Rumpf2021-04-073-17/+17
|
* ensure the avr example keeps compiling (#17663)Andreas Rumpf2021-04-071-0/+4
| | | | | | | * ensure the avr example keeps compiling * Update tests/avr/thello.nim * now compiles properly
* items(array)+friends: remove a RT comparison (#17650)Timothee Cour2021-04-061-8/+8
|
* implement RFCs/294 ; disallow enum <=> enum conversion (#16351)Timothee Cour2021-04-031-1/+1
| | | | | | | | | | | * fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
* fix #15617(fix compilation failure on -d:useMalloc --gc:none) (#17555)flywind2021-03-301-0/+10
| | | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* [backport:1.2] Avoid inlining of newObj and newObjRC1 calls (#17582)Miran2021-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | This is taken from: https://github.com/status-im/Nim/commit/af69b3ceae16281efd45cbee4ce1bedd14282304 Full original comment: This is to avoid heavy inlining happening when two allocation calls would occur shortly after each other. This inlining would sometimes be accompanied with an optimisation as the compiler is able to see that cellToUsr ending the first allocation call is shortly followed by an usrToCell call. The pointer arithmetic is redundant and the compiler can eliminate it, leaving only the cell address in a register (and later the stack) instead of the actual pointer to the user data, as one would expect. This combined with a GC collect cycle will cause the stack scan to only notice the cell address, which is of no good due to a usrToCell in the gcMark call which shifts that address to an adjacent cell. This means that the actual cell of importance will not get marked and thus cause a premature collection of that cell. BOOM.
* Fix #17299, fix setAffinity for android (#17574)Clyybber2021-03-301-2/+17
| | | | | | | * Fix #17299 * Comment * Fix typo
* [os:standalone]fix #14011 (#17564)flywind2021-03-291-2/+8
|
* [docs]close #12580 (#17549)flywind2021-03-281-2/+2
|
* follow up #17539 (#17548)flywind2021-03-291-1/+1
| | | | | * fix nim js cmp fails at CT * follow up #17539
* set const arch64 to fix compiling with vcc/icc (#17539)rockcavera2021-03-281-0/+1
|
* cleaned up the internal documentation (#17524)Andreas Rumpf2021-03-262-1/+81
|
* close #11330 sets uses optimized countSetBits (#17334)flywind2021-03-222-5/+73
| | | | | | | * Update lib/pure/bitops.nim * Update lib/system/sets.nim * Apply suggestions from code review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* prevent bitmasks double included in mmdist if -d:nimArcDebug added (#17436)Derek 呆2021-03-211-1/+2
|
* IC: green tests (#17311)Andreas Rumpf2021-03-193-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * IC: renamed to_packed_ast module to ic module * IC: don't store the --forceBuild flag, makes it easier to test * IC: enable hello world test * Codegen: refactorings for IC; changed the name mangling algorithm * fixed the HCR regressions * life is too short for HCR * tconvexhull is now allowed to use deepCopy * IC exposed a stdlib bug, required a refactoring * codegen: code cleanups * IC: even if a module is outdated, its dependencies might come from disk * IC: progress * IC: better name mangling, module IDs are not stable * IC: another refactoring helping with --ic:on --gc:arc * disable arraymancer on Windows for the time being * disable arraymancer altogether * IC: make basic test work with 'nim cpp' * IC: progress on --ic:on --gc:arc * wip; name mangling for type info
* rename channels to channels_builtin (#17330)flywind2021-03-121-0/+0
| | | | | | | * improve test coverage for isolation * a bit better * rename channels to channels_builtin
* Use `.. warning::` (#17320)konsumlamm2021-03-101-12/+12
|
* use lowercase --define switches (#17283)flywind2021-03-073-5/+5
|
* IC: further progress (#17150)Andreas Rumpf2021-03-051-3/+0
| | | | | | | * IC: respect the -f switch * IC: better rod file inspection * progress
* Added assertion to clamp (#17248)Jason Beetham2021-03-041-2/+5
| | | Co-authored-by: flywind <xzsflywind@gmail.com>
* followup #17225: simplify code after removing gc2, generational (#17242)Timothee Cour2021-03-033-4/+5
|
* Use readable escape sequences (#17241)Clyybber2021-03-031-1/+1
|
* rename prepareStrMutation to prepareMutation (#17235)flywind2021-03-031-2/+2
| | | | | | | * remove unnecessary when statement * remove outdated codes * rename prepareStrMutation to prepareMutation
* add runnableExamples for prepareStrMutation (#17227)flywind2021-03-021-1/+1
| | | | | * Update lib/system.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fixes #17173 (#17213)Andreas Rumpf2021-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | * fixes #17173 * add testcase (#17214) * Apply suggestions from code review * fix for newruntime * Apply suggestions from code review * Update lib/system.nim * Update lib/system.nim * Update lib/system.nim Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>
* Replace double backticks with single backticks - Part 2 out of ~6 (#17206)Danil Yarantsev2021-02-285-48/+48
|
* Replace double backticks with single backticks - Part 1 out of ~6 (#17205)Danil Yarantsev2021-02-2810-75/+75
|
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-284-6/+6
|
* fix #17159 items(cstring) works in VM (#17160)Timothee Cour2021-02-241-14/+45
| | | | | | | | | * fix #17159 items(cstring) works in VM * improve test coverage tests/stdlib/tcstring.nim; add helpers: whenRuntimeJs, whenVMorJs * document items(cstring) * address comments
* add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)Timothee Cour2021-02-231-2/+7
| | | | | | | * add enumutils.items for enum with holes * changelog * ref in lib.rst * use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept * address comment: rename back to enum with holes
* A few rst doc fixes (#17151)Danil Yarantsev2021-02-231-1/+1
| | | | | * Fix a couple of rst formatting issues * no need for the extra space
* add io.readChars overload (simpler, less error prone) (#16044)Timothee Cour2021-02-221-4/+8
| | | | | | | | | | * add simpler to use readChars overload * use new readChars overload * Update lib/wrappers/openssl.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* use single backtick (#17133)flywind2021-02-212-2/+2
|
* stricter checks for RST headlines (#17089)Andrey Makarov2021-02-201-1/+1
|