Commit Graph

178 Commits

Author SHA1 Message Date
flywind
75dc69417a fix deprecated messages regarding high (#15832) 2020-11-03 16:31:16 +01:00
Andreas Rumpf
06dfd31612 fixes #13881
* fixes #13881
* documented changed requirements for system.onThreadDestruction
* destructors.rst: update the documentation
2020-05-12 15:46:24 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* 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.
2020-04-28 19:56:01 +02:00
Arne Döring
4005f0d0e4 forward type alignment information to seqs (#12430) 2020-04-19 07:52:01 +02:00
Andreas Rumpf
a6682de004 catchable defects (#13626)
* allow defects to be caught even for --exceptions:goto (WIP)
* implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180
* new implementation for integer overflow checking
* produce a warning if a user-defined exception type inherits from Exception directly
* applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic'
* fixes #13627
* don't inherit from Exception directly
2020-03-12 23:44:33 +01:00
alaviss
f500895efe Unexport even more symbols (#13214)
* system/gc: don't export markStackAndRegisters

* compiler/cgen: unexport internal symbols

As these functions are Nim-specific walkaround against C's optimization
schemes, they don't serve any purpose being exported.

* compiler/cgen: don't export global var unless marked

* compiler/ccgthreadvars: don't export threadvar unless marked

* tests/dll/visibility: also check for exports

This ensure that these changes don't break manual exports.

* compiler/cgen: hide all variables created for constants

* compiler/ccgtypes: don't export RTTI variables

* compiler/ccgexprs: make all complex const static

* nimbase.h: fix export for windows

* compiler/cgen, ccgthreadvars: export variables correctly

For C/C++ variables, `extern` means that the variable is defined in an
another unit. Added a new N_LIB_EXPORT_VAR to correctly export
variables.
2020-01-23 13:45:31 +01:00
Andreas Rumpf
c52a2c3ab0 proof that refcounting can handle Nim's async (#12533) 2019-10-28 16:13:38 +01:00
Andreas Rumpf
0631d2dccc minor improvements 2019-10-27 17:50:30 +01:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
treeform
cbefb266bb Fix -d:logGC compile cerror: 'stdout not defined' (#12237) 2019-09-24 12:02:53 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
Arne Döring
88b5dd3362 right shift is now by default sign preserving (#11322)
* right shift is now by default sign preserving
* fix hashString and semfold
* enable arithmetic shift right globally for CI
* fix typo
* remove xxx
* use oldShiftRight as flag
* apply feedback
* add changelog entry
2019-05-29 16:48:00 +02:00
Andreas Rumpf
721bf7188b code cleanup: there is no tyOptRef 2019-02-22 19:42:11 +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
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
Andreas Rumpf
cd65e5328d GC: avoid pathological behaviour; fixes #10040 [backport] (#10052) 2018-12-20 08:20:32 +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
Araq
53566f7165 fixes #7833; still to-do: fix setLen 2018-07-30 23:27:01 +02:00
Andreas Rumpf
1aa359febb warn about inconsistent spacing around binary operators; fixes #7582 2018-05-05 14:58:33 +02:00
Araq
f1089db175 GC: enable precise global/thread local storage tracing 2018-01-15 17:41:05 +01:00
Araq
f71f9f83c2 GC improvements; distinguish between thread local and globals in the marking step 2018-01-14 17:34:27 +01:00
Araq
f1bf65f66e gc.nim: Add a gcAssert to enforce the no heap sharing restrictions 2018-01-12 15:08:02 +01:00
Yuriy Glukhov
d1e10f9aa3 Fixed mutex usage in SharedList and SharedTable. Closes #6988 (#6990) 2017-12-31 09:28:51 +01:00
Andreas Rumpf
6a3288a60e more replacements for the deprecated '<' 2017-10-29 08:55:30 +01:00
Araq
4a7266e1c1 fixes #3558 2017-10-16 12:29:40 +02:00
Andreas Rumpf
70e94b8c9e GCs: use add instead of & 2017-09-29 11:20:28 +02:00
Andreas Rumpf
f7f3a25be8 first steps of making 'opt' a first class type for Nim 2017-09-25 13:19:36 +02:00
Andreas Rumpf
88b65ea957 fixes #6234 2017-08-11 20:14:44 +02:00
Andreas Rumpf
e968fbb7dd added system.deallocHeap feature for Nim's native GCs 2017-07-22 11:38:47 +02:00
Andreas Rumpf
6f89323385 make the GCs more robust 2017-07-20 18:42:08 +02:00
Yuriy Glukhov
27c8efda9d decTypeSize on growObj (#5465) 2017-03-15 10:58:34 +01:00
Samantha Marshall
93753926f5 adding support for using llvm ASAN (#5536) 2017-03-14 23:33:56 +01:00
Rokas Kupstys
f80ddbbcc6 Use constant nimCoroutines instead of defined(nimCoroutines)
Variable
2017-02-20 17:24:19 +02:00
Rokas Kupstys
9f8863169a Cleanup of gc code
Cleanups
2017-02-20 17:24:19 +02:00
Rokas Kupstys
d69b701dde Coroutines realtime support 2017-02-20 17:24:19 +02:00
Rokas Kupstys
c3d1b732d6 Reworked gc support for coroutines. Nim now bootstraps with -d:nimCoroutines
Added gc test to coro.nim
Lots of misc improvements and comments in coro.nim
2017-02-20 17:24:19 +02:00
Rokas Kupstys
ff1bf74554 Delete fiber context when it exits (memleak fix)
Few correctness changes to gc stack management.
2017-02-20 17:24:19 +02:00
Rokas Kupstys
373e667dbc Coroutine rework.
* ucontext backend (default on unix)
* setjmp backend
* fibers backend (default and required on windows)
* Fixed coroutine loop timing issues
* Fixed saving of xmm registers on x64 windows
* Fixed alignment issues
* Updated coroutine sample with cooperative fibonacci calculation.
* Disable glibc security features only when platform jump functions are used
* Removed dependency on fasm.
    * Using fiber api on windows.
    * Other platforms and compilers  will use built in assembler and .S files or API provided by platform libc.
* Replaced stack switching procs with `coroExecWithStack()` which never returns. This makes compiler always generate proper code.
2017-02-20 17:24:19 +02:00
Araq
346ea6d171 system.nim: don't use deprecated symbols/constructs 2017-02-08 14:55:30 +01:00
Araq
79f4b37d3b added test case; threadex example crashes now 2017-01-30 21:11:37 +01:00
Andreas Rumpf
03916fa3b1 M&S GC gets the heap dump feature 2017-01-15 10:12:28 +01:00
Andreas Rumpf
823fbd4e40 default GC can do a sort of heap dump via -d:nimTypeNames and dumpNumberOfInstances() 2017-01-14 04:00:06 +01:00
Andreas Rumpf
36a9703866 Merge branch 'devel' into sighashes 2016-12-06 10:08:38 +01:00
Yuriy Glukhov
44ff8baf2a Show cell type name in writeCell 2016-12-06 00:31:26 +02:00
Araq
d2cbf7f242 more fixes 2016-12-02 08:37:51 +01:00
Araq
49667798eb further progress; more tests are green 2016-11-28 21:45:29 +01:00
Andreas Rumpf
d2d851a1f3 Merge pull request #4878 from yglukhov/gc-frameinfo
Cosmetics
2016-11-28 10:31:06 +01:00
Andreas Rumpf
249fd5e56b further memtracking improvements 2016-11-24 08:27:19 +01:00
Yuriy Glukhov
d857b4bc0e DRY frame info setting out to a template. 2016-11-03 19:16:10 +02:00