Commit Graph

1736 Commits

Author SHA1 Message Date
Amjad Ben Hedhili
a4df44d9fb Remove some unnecessary initialization in string operations (#22579)
* `prepareAdd`
* `toNimStr`
* `setLengthStrV2`
* `NimAsgnStrV2`
* `prepareMutation`
* Some cleanups
2023-09-07 05:45:54 +02:00
ringabout
2e7c8a339f newStringOfCap now won't initialize all elements anymore (#22568)
newStringOfCap nows won't initialize all elements anymore
2023-08-28 10:43:58 +02:00
Amjad Ben Hedhili
d77ada5bdf Markdown code blocks migration part 9 (#22506)
* Markdown code blocks migration part 9

* fix [skip ci]
2023-08-19 15:14:56 +02:00
Amjad Ben Hedhili
299394d21a Fix seq.capacity (#22488) 2023-08-17 06:38:15 +02:00
ringabout
ade75a1483 fixes #22481; fixes card undefined misalignment behavior (#22484)
* fixes `card` undefined misalignment behavior

* Update lib/system/sets.nim

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-08-15 23:31:44 +02:00
Andrey Makarov
a660c17d30 Markdown code blocks migration part 8 (#22478) 2023-08-15 06:27:36 +02:00
ringabout
10a6e4c236 clean up gc:arc or gc:orc in docs and in error messages (#22408)
* clean up gc:arc/orc in docs

* in error messages
2023-08-08 05:55:18 -04:00
konsumlamm
e15e19308e Revert adding generic V: Ordinal parameter to succ, pred, inc, dec (#22328)
* Use `int` in `digitsutils`, `dragonbox`, `schubfach`

* Fix error message
2023-08-06 00:38:46 +08:00
konsumlamm
d37b620757 Make repr(HSlice) always available (#22332)
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2023-08-04 05:29:48 +02:00
ringabout
1d2c27d2e6 bump the devel version to 211 (#22356) 2023-08-01 16:48:52 +02:00
ringabout
a23e53b490 fixes #22262; fixes -d:useMalloc broken with --mm:none and --threads on (#22355)
* fixes #22262; -d:useMalloc broken with --mm:none and threads on

* fixes
2023-08-01 15:18:08 +02:00
Bung
d51bc084fd remove thread duplicated code (#22348) 2023-07-31 10:58:59 +02:00
ringabout
9471b5f964 fixes #22256; fixes GC_disableOrc overflow (#22257) 2023-07-11 19:01:18 +02:00
Solitude
9ddd768cce Rename seq.add parameter to be consistent with refc (#22244) 2023-07-10 14:27:28 +02:00
Juan Carlos
148ff74c93 Fix #21401 (#22232) 2023-07-07 09:18:40 +02:00
Jacek Sieka
cb40f11e6c uint arithmetic for pointers (#22159)
pointers are not signed and arithmetic may correctly cross int.max
threshold

this PR only fixes 2 occurances - there are plenty however in the std
lib
2023-06-27 08:20:02 +02:00
tersec
3e44d5742f rm zero-extension and uint conversions deprecated since 0.19.9 (#22151) 2023-06-25 20:37:21 +02:00
Andreas Rumpf
8c3b0e9b48 added new experimental API isUniqueRef (#21812)
* added new experimental API isUniqueRef

* typo
2023-06-16 19:35:16 +02:00
Miran
7ea8f1d5dd bump NimVersion to 1.9.5 (#22112) 2023-06-16 17:20:28 +02:00
ringabout
0f3d6b5a52 small fixes for atomicArc (#22017)
* small fixes for atomicArc

* Update lib/system/arc.nim
2023-06-06 21:22:07 +02:00
ringabout
1133f20fe2 lift the =dup hook (#21903)
* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
2023-06-02 16:03:32 +02:00
ringabout
108410ac34 fixes fieldDefect loses enum type info in ORC; consistent with VM and refc (#21954)
fixes fieldDefect loses enum type info in ORC
2023-05-29 14:59:59 +02:00
Juan Carlos
b7925bf5c9 Remove GC (#21904)
* .

* Remove GC v2
2023-05-25 07:06:31 +02:00
ringabout
f22e5067c5 fixes #21847; let parseFloat behave like strtod (#21854) 2023-05-17 00:21:34 +02:00
Andreas Rumpf
f3a4cc584e make ORC threadlocal, take two (#21818)
* ORC: make rootsThreshold thread local [backport]

* fixes the regression
2023-05-10 12:54:43 +02:00
metagn
5592d1ef2c fix nimrtl and nimhcr on arc/orc (#21814)
* fix/workaround for nimrtl and nimhcr on arc/orc

fixes #21803

* try fix clang, debug linux failure

* just make duplicated procs not rtl

* actual fix for duplicated procs
2023-05-09 20:34:39 +02:00
Jordan Gillard
b169dad1e5 Improve and refactor cellseqs_v2 in Nim standard library (#21796)
* Refactor and optimize cellseqs_v2 in Nim standard library

* Extract resizing logic into a separate 'resize' procedure for better readability and separation of concerns
* Implement realloc for non-threaded cases to improve memory operations efficiency
* Use ',' instead of ';' between parameters in 'add' procedure for consistency with other Nim code

* Respond to Araq's feedback: Refactor resize function to use reallocShared

This commit replaces the usage of allocShared and deallocShared with reallocShared to optimize memory allocation and deallocation while resizing the CellSeq.
2023-05-09 20:33:35 +02:00
ringabout
4533e894ad adds an experimental mm:atomicArc switch (#21798) 2023-05-08 16:25:47 +02:00
Jordan Gillard
71f2e1a502 🚀 Enhancing CellSeq for Better Readability and Maintainability (#21797)
Refactor and improve readability of CellSeq in system directory

* Use half-open range in the contains procedure for better readability and to avoid potential off-by-one errors
* Extract resizing logic from add procedure into a separate resize procedure for better code readability and separation of concerns
2023-05-07 09:25:25 +02:00
ringabout
4a94f3606e revert #21799 and #21802 which don't pass the tests (#21804)
* Revert "ORC: make rootsThreshold thread local [backport] (#21799)"

This reverts commit b74d49c037.

* Revert "fixes #21752 [backport] (#21802)"

This reverts commit d0c62fa169.
2023-05-07 09:22:42 +02:00
ringabout
b562e1e6d8 implement =dup hook eliminating wasMoved and =copy pairs (#21586)
* import `=dup` hook eliminating `wasMoved` and `=copy` pairs

* add dup

* add a test for dup

* fixes documentation

* fixes signature

* resolve comments

* fixes tests

* fixes tests

* clean up
2023-05-06 21:36:57 +02:00
Andreas Rumpf
b74d49c037 ORC: make rootsThreshold thread local [backport] (#21799) 2023-05-06 17:58:00 +02:00
Andreas Rumpf
79ac242c72 fixes #21780 [backport:1.6] (#21785)
* fixes #21780 [backport:1.6]

* complete patch
2023-05-04 16:42:04 +02:00
metagn
380dafcc32 fix iterator equality + add test for proc equality + fix sameType (#21707)
* fix iterator equality + add test also for procs

fixes #21706

* all targets

* and isNil and repr

* separate overloads, fix sameType

* more restricted sameType?

* merge overloads again??

* remove sametype change for now

* fix sameType anyway (CI failure was not related)

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2023-04-23 17:43:59 +08:00
Raynei
48de0d0cf4 Documented path substitution by compiler (#21662)
Document compiler path substitution (nim-lang#19928)
2023-04-21 15:37:21 +02:00
Bung
0d6b994bee fix #20997 (#21165)
* fix #20997

* use ptr UncheckedArray[uint8] instead
2023-04-19 09:50:49 +02:00
metagn
b0a98cc01e warn on set types bigger than max size, default to 0..255 for int literals (#21659)
* test implicitly huge set types

refs https://github.com/nim-lang/RFCs/issues/298

* oh my god

* boot at least

* don't error, fix remaining issues, no 2 len arrays

* fix runnable example

* test assuming 0..255 for int literal

* test refactor, add changelog, test
2023-04-17 20:55:22 +02:00
ringabout
91e4381a20 fixes #20155; repr range with distinct types is broken in ORC (#21682)
fixes #20155; repr range with distinct types is broken with ORC
2023-04-17 17:08:53 +02:00
metagn
f05387045d int64/uint64 as bigint in JS (#21613)
* int64/uint64 as bigint in JS

* fix CI

* convert to compile option

* fix lie

* smaller diff, changelog entry
2023-04-11 21:20:20 +02:00
ringabout
3575f2bf9c fix #20972 fixes invalid and UB codegen case object transitions for both refc and ORC [backport] (#21611)
fix #20972 fixes invalid and UB codegen case object transitions for refc and ORC
2023-04-04 12:18:43 +02:00
Andreas Rumpf
d5719c47dc make --exceptions:quirky work with C++ (#21581)
* make --exceptions:quirky work with C++

* make tests green again
2023-03-31 04:16:09 +02:00
Miran
2e4ba4ad93 bump NimVersion to 1.9.3 (#21587) 2023-03-30 20:25:14 +02:00
tersec
e8a70ff179 don't access void* out of alignment in refc GC to avoid UB (#21560) 2023-03-22 22:05:20 +01:00
Regis Caillaud
ba22826e9b Add check for nimMaxJeap on occupied memory + allocation size (#21521)
* fix nimMAxHeap checks

* move check to alloc pages

* remove debug trace

* Fix bad indentation

How the hell did that pass through CI ?
2023-03-20 18:49:18 +01:00
Andreas Rumpf
8a19ac2070 fixes #21393 and misc style changes (#21419)
* fixes #21393 and misc style changes

* progress

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2023-02-24 09:02:15 +01:00
Century Systems
3b9e9fd7b2 Add support for NuttX RTOS. (#21372)
* Add support for NuttX RTOS.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>

* lib: pure: asyncdispatch: assign to result.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>

* lib: std: typedthreads: add support for parameters to adjust Thread Stack Size.

Like FreeRTOS/Zephyr, add support for following configurations.

  -d:nimThreadStackSize=xxxxx
  -d:nimThreadStackGuard=yyyy

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>

---------

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-16 13:47:52 +01:00
ringabout
ebd1c678be fixes #21195; std/assertions continue to use sysFatal when nimPreviewSlimSystem is not defined (#21196)
* fixes #21195; `std/assertions` continue to use `sysFatal`

* try includes

* make `std/assertions` self-contained

* fixes tests

* fixes tests
2022-12-29 14:15:08 -05:00
ringabout
4b63ac4b87 fixes #21171; dynamic acyclic refs need to use dyn decRef (#21184)
* fixes #21171; dyn destructors for acyclic inherited  refs

* add a test

* Update compiler/liftdestructors.nim
2022-12-28 16:23:37 +01:00
ringabout
f7c203fb6c remove legacy code (#21134)
* remove legacy code

* fixes
2022-12-26 13:20:05 +01:00
Bung
0b319fee3d fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 … (#21010)
* fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 uses mismatched C array sizes
* fullfil set variant
2022-12-23 12:20:25 +01:00