summary refs log tree commit diff stats
path: root/lib/system
Commit message (Collapse)AuthorAgeFilesLines
* fix #14179, fix #14142, make CI 1.4x faster (2x faster locally) (#14658)Timothee Cour2020-06-161-3/+8
| | | | | | | | | | | | | | | * fix #14142: no more clash with: import os + use of existsDir/dirExists/existsFile/fileExists/findExe in config.nims * remove a comment * Revert "fixes the regression #12860 caused; hotfix" This reverts commit 3d2459bdc0b6d6236a2cd9209ed81c965ee411a5. * Revert "Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)" This reverts commit d38853c504d89d6e361f064a17391afaf42d74b8. * noNimScript => noWeirdTarget + noNimJs
* fix #14655 setLen(seq) now zeros memory (#14656)Timothee Cour2020-06-141-14/+15
| | | | | * simplify sysstr.nim * fix #14655
* remove tyOpt, mOpt (#14636)Timothee Cour2020-06-121-1/+1
| | | | | * remove tyOpt, mOpt * fixup
* exceptions.nim: Fix a bad `Error` -> `Defect` renaming (#14621)ee72020-06-101-1/+1
| | | This commit fixes a mistake from 7d6cbf290a.
* io: correct signature for some win32 apis (#14551)alaviss2020-06-031-5/+5
| | | See https://github.com/nim-lang/Nim/pull/14550#issuecomment-637937649
* fix #14421 items uses lent T (#14447)Timothee Cour2020-05-291-3/+28
| | | | | * fix #14421 items uses lent T for seq + openArray * add -d:nimWorkaround14447 * fix test
* hotfix doc comments for procs without body (#14494)Timothee Cour2020-05-291-5/+0
|
* more checking for --gc:arc, no need for valgrind (#14467)Andreas Rumpf2020-05-298-69/+145
| | | | * sigmatch: removed dead code
* fix repr(char) example assert (#14437)hlaaftana2020-05-231-1/+1
|
* make malloc.nim consistent in style (#14427)Andreas Rumpf2020-05-221-9/+9
|
* ARC/ORC: optimize s.setLen(0) to match the old runtime's behaviour (#14423)Andreas Rumpf2020-05-211-2/+1
|
* Small improvements for string and char repr with gc:arc (#14400)Clyybber2020-05-201-6/+8
| | | | | * Small improvements for string and char repr with gc:arc * Fix test
* specialize genericReset (#14398)Andreas Rumpf2020-05-191-1/+1
| | | | | | | * progress * make tests green * maybe we also want to reset pointers, dunno * progress * cleanup; fixes #13879 [backport:1.2]
* trunner was not actually being tested in non-CTFFI mode; minor testament ↵Timothee Cour2020-05-191-1/+1
| | | | | | | | | | cleanups (#14377) * use check * trunner now works with cpp * cleanup: move compiler/unittest_light => stdtest/unittest_light * fix tests/readme.md * remove deadcode references to rodfiles * fix for windows
* add OpenBSD MAP_STACK for coroutines (#14353)John2020-05-161-4/+10
|
* fixes #14370 (#14371)Andreas Rumpf2020-05-162-2/+2
|
* fixes #13862Araq2020-05-131-1/+1
|
* fixes #13935Andreas Rumpf2020-05-131-0/+3
|
* cycle collector: make it threadsafeAraq2020-05-121-5/+5
|
* fixes #13881Andreas Rumpf2020-05-125-18/+34
| | | | | | * fixes #13881 * documented changed requirements for system.onThreadDestruction * destructors.rst: update the documentation
* do not track 'raise Defect' in the .raises: [] clause anymore (#14298)Andreas Rumpf2020-05-111-1/+6
| | | | | | | | | * do not track 'raise Defect' in the .raises: [] clause anymore * --panics:on maps 'raise Defect' to an unrecoverable fatal error * make tests green again * update the documentation too
* Fix for --styleCheck:errorAntonis2020-05-111-4/+4
|
* Fix #14270 and add testcases (#14276)Clyybber2020-05-081-2/+6
|
* fix js stacktraces, unify all file,line,col formatting into a single ↵Timothee Cour2020-05-053-11/+10
| | | | | function (#14230) * fix https://github.com/timotheecour/Nim/issues/135 ; unify all file,line,col formatting into a single function
* fixes #14209 [backport:1.2] (#14213)Andreas Rumpf2020-05-051-1/+1
| | | | * fixes #14209 [backport:1.2] * improve stability
* Fix #14151 (#14205) [backport]slangmgh2020-05-031-8/+2
|
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-023-19/+2
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* Document that proc named fooTask is created for every foo task [backport] ↵Kaushal Modi2020-05-021-0/+15
| | | | | (#14187) Ref: https://irclogs.nim-lang.org/01-05-2020.html#15:18:03
* change 'iff' to 'if' to stop "corrections" once and for all (#14182)Miran2020-05-012-5/+5
|
* fixes #13698 [backport:1.2] (#14175)Andreas Rumpf2020-04-301-2/+2
|
* fixes the regression #12860 caused; hotfixAraq2020-04-301-0/+3
|
* JS unittest stacktrace fix, cleanup js repr and inclrtl includes (#14168)hlaaftana2020-04-301-34/+12
|
* many bugfixes for js (#14158)hlaaftana2020-04-292-23/+16
| | | | | | | | | | | | | * many bugfixes for js fixes #12672, fixes #14153, closes #14123, closes #11331, fixes #11783, fixes #13966, fixes #14087, fixes #14117, closes #12256. mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing. * formatting fixes * CI fixes * more CI fixes
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-2814-78/+101
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* StringStream & more stdlib modules support for JS/NimScript (#14095)hlaaftana2020-04-281-1/+1
| | | | | * StringStream & more stdlib modules support for JS/NimScript * change back pegs test in line with #14134
* Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)Neelesh Chandola2020-04-271-8/+0
| | | | | | | * Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim * Update changelog.md * Update stable nimble commit hash Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* `$` now works for unsigned intergers with `nim js` (#14122)Timothee Cour2020-04-271-0/+17
| | | | * $(unsigned) now works for js * move NimMajor+friends closer to NimVersion according as per reviewer feedback
* `$(a: float)` now works consistently in nim js, avoiding printing floats as ↵Timothee Cour2020-04-271-0/+15
| | | | | | | | | ints (#14134) * fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends * fix tests * fix test for windows that prints 1.1e17 differently than other OS
* new implementations for --gc:orc (#14121)Andreas Rumpf2020-04-276-19/+418
| | | | | | | | | * cycle collector: new implementation * cycle collector: make self-adaptive based on its previous effectiveness * cycle collector: added Lins's jump stack to improve traversal from 3*N to 2*N * cycle collector: make tests green * API extensions and bugfixes * code cleanup and use --gc:orc for tasyncawait
* since now takes an optional patch, eg: `since: (1, 3, 1)` (#14124)Timothee Cour2020-04-261-2/+14
| | | add tests for tinclrtl
* changed type() to typeof() in docs and error messages (#14084)hlaaftana2020-04-241-3/+3
|
* cycle collector (#14071)Andreas Rumpf2020-04-223-106/+74
| | | | * figured out the wrong cycle trace proc problem * cycle collector/break refactorings and minor improvements
* Treat zig like clang/gcc wrt integer arithmetic. (#13957)Hessam Mehr2020-04-221-1/+1
|
* fixes #14038Andreas Rumpf2020-04-201-1/+1
|
* Make file descriptors from stdlib non-inheritable by default (#13201)alaviss2020-04-201-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * io: make file descriptors non-inheritable by default This prevents file descriptors/handles leakage to child processes that might cause issues like running out of file descriptors, or potential security issues like leaking a file descriptor to a restricted file. While this breaks backward compatibility, I'm rather certain that not many programs (if any) actually make use of this implementation detail. A new API `setInheritable` is provided for the few that actually want to use this functionality. * io: disable inheritance at file creation time for supported platforms Some platforms provide extension to fopen-family of functions to allow for disabling descriptor inheritance atomically during File creation. This guards against possible leaks when a child process is spawned before we managed to disable the file descriptor inheritance (ie. in a multi-threaded program). * net, nativesockets: make sockets non inheritable by default With this commit, sockets will no longer leak to child processes when you don't want it to. Should solves a lot of "address in use" that might occur when your server has just restarted. All APIs that create sockets in these modules now expose a `inheritable` flag that allow users to toggle inheritance for the resulting sockets. An implementation of `setInheritance()` is also provided for SocketHandle. While atomically disabling inheritance at creation time is supported on Windows, it's only implemented by native winsock2, which is too much for now. This support can be implemented in a future patch. * posix: add F_DUPFD_CLOEXEC This command duplicates file descriptor with close-on-exec flag set. Defined in POSIX.1-2008. * ioselectors_kqueue: don't leak file descriptors File descriptors internally used by ioselectors on BSD/OSX are now shielded from leakage. * posix: add O_CLOEXEC This flag allows file descriptors to be open() with close-on-exec flag set atomically. This flag is specified in POSIX.1-2008 * tfdleak: test for selectors leakage Also simplified the test by using handle-type agnostic APIs to test for validity. * ioselectors_epoll: mark all fd created close-on-exec File descriptors from ioselectors should no longer leaks on Linux. * tfdleak: don't check for selector leakage on Windows The getFd proc for ioselectors_select returns a hardcoded -1 * io: add NoInheritFlag at compile time * io: add support for ioctl-based close-on-exec This allows for the flag to be set/unset in one syscall. While the performance gains might be negliable, we have one less failure point to deal with. * tfdleak: add a test for setInheritable * stdlib: add nimInheritHandles to restore old behaviors * memfiles: make file handle not inheritable by default for posix * io: setInheritable now operates on OS file handle On Windows, the native handle is the only thing that's inheritable, thus we can assume that users of this function will already have the handle available to them. This also allows users to pass down file descriptors from memfiles on Windows with ease, should that be desired. With this, nativesockets.setInheritable can be made much simpler. * changelog: clarify * nativesockets: document setInheritable return value * posix_utils: atomically disable fd inheritance for mkstemp
* refactor system.$ for objects a little; refs #13398Araq2020-04-201-9/+3
|
* fixes #14001 (#14004)Andreas Rumpf2020-04-191-5/+5
|
* forward type alignment information to seqs (#12430)Arne Döring2020-04-1917-84/+93
|
* Fix unused warning for `$` for empty tuple/objects (#13991)hlaaftana2020-04-181-1/+2
|
* added extended msg for failed library loads w/ incorrect DLL formats (#13950)awr12020-04-162-12/+30
| | | | | | | | | | | | | | | * added extended msg for failed library loads w/ incorrect DLL formats * missing colon * fix GetLastError() * make GetLastError() available for windows console apps * remove premature nullchar if outputting extra message * if-protect nullchar detection * better fix for message box code