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

Simplify the GC.gc interface #34303

Merged
merged 1 commit into from
Jan 8, 2020
Merged

Simplify the GC.gc interface #34303

merged 1 commit into from
Jan 8, 2020

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jan 7, 2020

Implements #33448 (comment). Previous API is only part of 1.4, so this is not breaking (yet).

@JeffBezanson JeffBezanson merged commit b0ed147 into master Jan 8, 2020
@JeffBezanson JeffBezanson deleted the tb/gc_simplify branch January 8, 2020 05:46
maleadt added a commit to JuliaGPU/CuArrays.jl that referenced this pull request Jan 8, 2020
On the latest Julia this API is equivalent to the explicit use.
Ref JuliaLang/julia#34303
KristofferC pushed a commit that referenced this pull request Jan 8, 2020
@KristofferC KristofferC mentioned this pull request Jan 8, 2020
28 tasks

!!! warning
Excessive use will likely lead to poor performance.
"""
gc(full::Bool=true) = ccall(:jl_gc_collect, Cvoid, (Cint,), full)
gc(collection::CollectionType) = ccall(:jl_gc_collect, Cvoid, (Cint,), collection)
gc() = ccall(:jl_gc_collect, Cvoid, (Cint,), 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, read this too quickly since it was supposed to be not a breaking change. This was a breaking change (as in CI has been broken for a week now because of this PR):

Suggested change
gc() = ccall(:jl_gc_collect, Cvoid, (Cint,), 0)
gc() = ccall(:jl_gc_collect, Cvoid, (Cint,), 1)

Please, please, please be careful about merging PRs that fail on CI (as this one did).

Copy link
Member

@StefanKarpinski StefanKarpinski Jan 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if they are not wrapped in a type or user-facing, it might be good for this code to use locally-defined constants to make the code easier to read. My understanding is that these are the values:

const GC_AUTO = 0
const GC_FULL = 1
const GC_INCR = 2

Is that correct? If so, it would be good to define these constants and then use them in the method definitions. I guess the issue is that the default previously was GC_FULL rather than GC_AUTO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crap, sorry for that, I had been too accustomed to win32 failing recently...

Even if they are not wrapped in a type or user-facing, it might be good for this code to use locally-defined constants to make the code easier to read.

Agreed, I'll see about improving that next week.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crap, sorry for that, I had been too accustomed to win32 failing recently...

💯 I wouldn't blame you here. CI needs to be fixed. The situation is atrocious.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I rather regret not merging #33741 to fix a major contributor months ago, but we really need to prioritize getting the other known fixes merged (#34336, #33785, and #34242 at least) too.

vtjnash added a commit that referenced this pull request Jan 10, 2020
Removes the breaking part of b0ed147
from PR #34303
JeffBezanson pushed a commit that referenced this pull request Jan 15, 2020
KristofferC pushed a commit that referenced this pull request Jan 21, 2020
Removes the breaking part of b0ed147
from PR #34303

(cherry picked from commit 15d693b)
KristofferC pushed a commit that referenced this pull request Jan 21, 2020
Removes the breaking part of b0ed147
from PR #34303

(cherry picked from commit 15d693b)
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
Removes the breaking part of b0ed147
from PR #34303
BioTurboNick pushed a commit to BioTurboNick/julia that referenced this pull request Apr 13, 2020
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

Successfully merging this pull request may close these issues.

5 participants