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

Gc_ref(x: string) and Gc_ref[T](x: seq[T]) doesn't exists anymore ? #23634

Closed
Alogani opened this issue May 21, 2024 · 2 comments
Closed

Gc_ref(x: string) and Gc_ref[T](x: seq[T]) doesn't exists anymore ? #23634

Alogani opened this issue May 21, 2024 · 2 comments

Comments

@Alogani
Copy link

Alogani commented May 21, 2024

Description

Hello,

Gc_ref(x: string) and Gc_ref[T](x: seq[T]) both throws a type mismatch on nim 2.0 when using --mm:orc or --mm:arc (works with --mm:refc)

It seems a pretty strong problem when interfacing with unmanaged memory efficiently

Nim Version

nim v2.0.4 - fedora linux

Current Output

var x1 = "nim"
GC_ref(x1)

var x2 = @["is nice"]
GC_ref(x2)

>>> nim r myfile.nim
Expression: GC_ref(x1)
  [1] x1: string

Expected one of (first mismatch at [position]):
[1] proc GC_ref[T](x: ref T)
@beef331
Copy link
Collaborator

beef331 commented May 21, 2024

With orc and arc seq and string are not ref counted, they're treated as value types which own their memory.

@Alogani
Copy link
Author

Alogani commented May 21, 2024

Ok, I understand.
A bit deceiving we can't access more easily their internals.

But if this is not a bug, I close this issue. Thanks

@Alogani Alogani closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
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

2 participants