Commit Graph

1130 Commits

Author SHA1 Message Date
Timothee Cour
942495611b revive #10228 (fix #9880) (#10610)
* Make index out of bounds more useful by including the 'bounds'.
* fixes #9880 index out of bounds (remaining cases); revives #10228
* change err msg to: `index 3 not in 0 .. 1`
2019-02-13 23:30:14 +01:00
Federico Ceratto
8f05b34125 Add note on channel usage with spawn (#10627) [ci skip] 2019-02-13 23:30:14 +01:00
Brent Pedersen
fe26328a19 sets: avoid calling countBits32 for 0 (#10619)
this speeds up the system.sets time from ~0.2 to ~0.06
in release mode. This is still slower than intsets and
tables (which both are ~0.01).

This assumes that most sets will be sparse.

fixes #10617
2019-02-13 23:30:14 +01:00
cooldome
d70dd6f3cb Move cpp exception handler from system to excpt next to the signal handler (#9435) 2019-02-13 23:30:14 +01:00
Andreas Rumpf
0841c64a32 Merge branch 'devel' into araq-quirky-exceptions 2019-02-08 17:18:17 +01:00
Araq
d5da450100 helpers2 now has a real name 2019-02-07 12:12:20 +01:00
Andreas Rumpf
37f9ace517 further system.nim cleanups 2019-02-06 22:35:51 +01:00
Andreas Rumpf
0036014727 system refactorings (#10559)
* move IO subsystem into its own module; refs #10385
* make standalone test compile again
* make C++ examples compile again
* make more tests green
* make sysAssert and gcAssert work again
2019-02-06 21:00:00 +01:00
Timothee Cour
e98bd3aceb fix #10488 GC memory leak regression (#10498)
* fix #10488 GC memory leak regression

* re-enable gch.stack.bottom.repr but only inside when defined(logGC)
2019-01-30 09:26:33 +01:00
Andreas Rumpf
dee8e6e98a gc: destructors is beginning to work (#10483)
* kochdocs.nim: code cleanup
* docgen: nicer indentation
* parser.nim: code cleanup
* fixes #10458
* make tests green again
* make =destroy mixins
* gc:destructors: produced C code is almost working
* --gc:destructors simple program compiles (but leaks memory)
* gc:destructors make examples compile in C++ mode
* destructors: string implementation bugfixes
* strs.nim: minor code cleanup
* destructors: builtin seqs are beginning to work
* remove debugging helpers
2019-01-29 15:12:16 +01:00
Federico Ceratto
7533f3bcbd Add link to nims.html (#10472) [ci skip] 2019-01-27 17:27:54 +01:00
Matt Haggard
3c106541fa Increase verbosity of logGC (#10449)
* Increase verbosity of logGC

* Remove & c.repr to avoid re-entering the GC
2019-01-26 12:26:36 +01:00
Araq
70c7348d3e gc:regions: undo the regression introducing changes 2019-01-25 09:49:16 +01:00
Araq
c4d2cb9ea6 excpt.nim: code cleanup, don't produce nimFrame in -d:release mode 2019-01-23 22:03:15 +01:00
Araq
40d1c7d43a OutOfMemError is never raised so there is no need to check for it (produce less code) 2019-01-23 22:03:15 +01:00
Araq
458c827077 make --define:noSignalHandler compile again 2019-01-22 11:45:45 +01:00
LemonBoy
7a3f382517 Fix corner case of checked div/mod on x86 (#10406)
Fixes #10377
2019-01-22 07:33:27 +01:00
Andreas Rumpf
f7c0360aba allocators: introduce --define:nimMinHeapPages for tuning mmap calls (omg they are slow on OSX...) 2019-01-19 12:48:39 +01:00
Reimer Behrends
06e3d3ab4d Disable interior pointer checking by default for the Boehm GC. (#10316)
The Boehm GC only needs interior pointer checking if pointers in global
variables or on the heap point to the interior of an object rather than
the beginning. If this does not happen, then checking for interior
pointers causes additional overhead, in particular because any objects
whose sizes are an exact multiple of two words gain another two words of
padding, wasting memory.

If checking of interior pointers is still desired, this can be achieved
by setting the environment variable GC_ALL_INTERIOR_POINTERS.

Pointers on the stack will always be treated as potential interior
pointers, as compiler optimizations may advance the only live reference
to a point past the beginning of an object.
2019-01-15 19:00:02 +01:00
genotrance
c707267212 Add stdin read support to nimscrit #3983 (#10292) 2019-01-14 09:26:10 +01:00
Araq
451377f737 fixes #10271 [backport] 2019-01-13 14:24:38 +01:00
Araq
5cd18b0f24 make system.task compatible with NimScript; refs #10254 2019-01-13 09:04:57 +01:00
Araq
647066e378 make the stdlib work with the changed docgen 2019-01-11 22:17:43 +01:00
Vindaar
8e600b78ca add unsetControlCHook to remove a Ctrl-C hook after it was set (#7267)
* add unsetControlCHook to remove a Ctrl-C hook after it was set

Adds the inverse proc to setControlCHook in order to lift a Ctrl-C
hook after it has been set.

* remove check for noSignalHandler in system/excpt.nim
2019-01-10 13:44:44 +01:00
Timothee Cour
6ce3949c8a add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
2019-01-08 18:37:25 -08:00
alaviss
20402579a2 system/strmantle: avoid leaking docs to system.nim [ci skip] (#10233)
thanks @timotheecour for spotting this
2019-01-08 08:42:10 +01:00
alaviss
be0a4d1342 fix system.nim documentations (#10168)
* system: fix nimGC_getStackBottom doc
* system/helpers: avoid leaking docs to system
2019-01-04 15:13:07 +01:00
rec
ba7d33b4e4 Guard against null exception (#10162) 2019-01-04 15:05:03 +01:00
Andreas Rumpf
cb9110c43d --define:nimQuirky exception handling for Nim; in preparation of a blog post 2019-01-03 18:56:05 +01:00
Timothee Cour
eba8ffcf70 checkErr now shows actual system error msg instead of unknown error (#9987) 2018-12-27 22:46:53 +01:00
Andreas Rumpf
cd65e5328d GC: avoid pathological behaviour; fixes #10040 [backport] (#10052) 2018-12-20 08:20:32 +01:00
Neelesh Chandola
48437d0a84 Give better error message when profiler and memProfiler used at same time (#9948)
* Give better error message when profiler and memProfiler used at same time

* Move to profiler.nim
2018-12-19 10:02:20 +01:00
Andreas Rumpf
d7d17d5ab0 see what breaks with a global config.nims (#10016)
* see what breaks with a global config.nims

* make tests green with a global config.nims file
2018-12-18 09:29:15 +01:00
Timothee Cour
c4e3c4ca2d add getCurrentCompilerExe to vmops (eg allows to get nim compiler at CT); add tests for vmops (#9925) 2018-12-18 09:07:12 +01:00
Araq
09b9a54418 make tests green with a global config.nims file 2018-12-17 23:03:54 +01:00
Araq
d91d1865b8 fixes #9420 2018-12-16 20:11:04 +01:00
Araq
359a4b5fac timers.nim: avoid parser warning 2018-12-14 09:56:43 +01:00
Andreas Rumpf
5dc83d0c8f cleanup of excpt.nim 2018-12-11 23:04:49 +01:00
Andreas Rumpf
e3d91a5b74 Merge pull request #9923 from stefantalpalaru/calldepth
replace misleading "stack overflow" message when reaching Nim's call depth limit
2018-12-11 22:07:44 +01:00
Ștefan Talpalaru
497e8c41e8 replace misleading "stack overflow" message on call depth limit
The new error message looks like this:
"Error: call depth limit reached in a debug build (2000 function calls).
You can change it with -d:nimCallDepthLimit=<int> or switch to a release
build with -d:release."
2018-12-10 19:35:37 +01:00
Timothee Cour
f3ecc15a94 refs #9880 show index and bound in lots of index out of bounds errors 2018-12-09 16:50:45 -08:00
rec
e3e5ae287f Fix fat pointers, object copying, magic double evals on JS (#9411) [backport]
* Add a test for issue #9389

* Fixes #9389.

* Make object contructors copy objects properly by checking whether the expressions passed to them don't need to be copied.
* Make mArrToSeq implementation actually check if a copy needs to be made.

* Avoid unnecessary copy in mChr impl

* Assume set constructor elements need no copy

* Add a test for issue #9410

* Add a test

* fix passing fat pointers (#9410)

* Enhance tests

* More tests and fixes

* Add more (failing) tests [ci skip]

* Added equality operator for fat pointers, more tests and fixes

* Fix printing uninitialized strings

* Fix mInc, mDec double eval, add more tests

* Tests

* Refactored, fixed multiple evals, revamped the tests, added missing ops

* Fix ups

* Fix #9643 and #9644

* add pointer normalization
2018-12-04 12:04:27 +01:00
Jacek Sieka
87568830ab Remove dead code (#9777)
* gc/gc2: remove unused ref counting stuff
* also removes some false threading support - hasSharedHeap is always
false in gc/gc2
* gc: remove some threading cruft
* remove asgnRefNoCycle
* compiler: remove TLoc.dup (unused)
2018-11-26 09:47:39 +01:00
alaviss
c7eba64dee don't raise exception in the default handler (#9783)
fixes #9657
2018-11-22 14:46:07 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Araq
dd3e1cbc9b make testament compile again with -d:nimCoroutines 2018-11-15 15:15:20 +01:00
Andreas Rumpf
632ec94b5d gc_common: fixes a typo 2018-11-15 11:36:35 +01:00
Andreas Rumpf
8d850f7a69 deprecated ospaths (#9665) 2018-11-09 16:36:49 +01:00
Araq
5c25b93898 change system.nim to adhere to the style guide 2018-10-30 15:03:28 +01:00
cooldome
dfb8730f51 Implements #9434. Minimal Stacktrace for Exceptions in release mode (#9480)
* Fixes #9434
2018-10-28 13:40:42 +01:00