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

[ARC] Question on allocation handlings for seqs, string and refs #15574

Closed
cooldome opened this issue Oct 14, 2020 · 3 comments · Fixed by #15588
Closed

[ARC] Question on allocation handlings for seqs, string and refs #15574

cooldome opened this issue Oct 14, 2020 · 3 comments · Fixed by #15588

Comments

@cooldome
Copy link
Member

Seqs and strings in arc mode are using sharedAlloc and deallocShared for memory management.

However refs are using:

when  defined(useMalloc):
    c_malloc(cuint s)    
elif compileOption("threads"):
    allocShared0(s)
else:
    alloc0(s)

I would like to aligns the approaches, but I am not sure if I would fix seqs/strings or refs.
Bare in mind that alloc, allocShared and c_malloc are the same thing under useMalloc, but are different otherwise.

Araq,
Please opine on what is the desired memory allocation approach and I will prepare a PR.

@Araq
Copy link
Member

Araq commented Oct 15, 2020

seqs/strings should follow ref's implementation strategy. Unless you can come up with good arguments for a different setup.

@cooldome
Copy link
Member Author

Possibly, we can simplify it a little bit:

when compileOption("threads"):
    allocShared0(s)
else:
    alloc0(s)

When useMalloc is defined both allocShared and alloc means c_malloc already.
Does it sound good?

@Araq
Copy link
Member

Araq commented Oct 15, 2020

Yes.

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

Successfully merging a pull request may close this issue.

2 participants