Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules cdt and cdt2 do not work with latest devel compiler #2

Open
StefanSalewski opened this issue Dec 14, 2022 · 0 comments
Open

Comments

@StefanSalewski
Copy link
Owner

There are two issues: A simple one:

Line 112 in minmax.nim

func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure, noSideEffect.}): T =
#func minValueBy*[T](s: openArray[T], cmp: proc (x, y: T): int {.closure.}): T =

More recent compiler versions needs the noSideEffect pragma (or we may make minValueBy() a plain proc.) Making
the symbol after cmp: a func seems not to work.

The other issue is

grep cursor /home/salewski/.nimble/pkgs/cdt-0.1.1/cdt/*
/home/salewski/.nimble/pkgs/cdt-0.1.1/cdt/types.nim:    next*{.cursor.}: Edge # added {.cursor.} for v 0.1.1

We added the cursor pragma years ago to make it compile with --gc:arc. Orc was not available at all that time.
Now, we can remove the cursor pragma, and it compiles with orc, arc, and refc. So the obvious fix is to remove that pragma now. But with arc the cdt module may leak memory, due to the complicated quad-edge data structure. May the cursor pragma avoid leaks for arc? We don't know currently.

But to avoid the ugly crashes, we will remove the cursor pragma for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant