-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP/NFC: create GC interface for third-party GCs #55256
Conversation
bb47811
to
a564641
Compare
d3e10d6
to
84ce9b5
Compare
84ce9b5
to
425fa38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, good step towards modularizing the GC.
I'm not familiar enough with the LLVM side of things to review that part of the code, so need more reviews.
JL_DLLEXPORT void jl_gc_add_finalizer(jl_value_t *v, jl_function_t *f) JL_NOTSAFEPOINT; | ||
JL_DLLEXPORT void jl_gc_add_ptr_finalizer(jl_ptls_t ptls, jl_value_t *v, void *f) JL_NOTSAFEPOINT; | ||
JL_DLLEXPORT void jl_gc_add_quiescent(jl_ptls_t ptls, void **v, void *f) JL_NOTSAFEPOINT; | ||
JL_DLLEXPORT void jl_finalize(jl_value_t *o); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these also go into gc-interface.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
If they had to be moved somewhere, it would be to gc-common.h
, though I'm not fully convinced of it since the MMTk binding is not using this code now IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My inclination is to keep them here for now.
425fa38
to
038eac0
Compare
3d6311f
to
f8ef014
Compare
f8ef014
to
469023c
Compare
Prelude to the MMTk integration. Creates an interface header specifying the functions that a third-party GC must implement to plug into Julia, and also splits the stock Julia GC implementation into a separate file `gc-stock.c`. In the future, we'll include a few pre-processor guards to ensure some of these files are not compiled if MMTk is enabled. A WIP design document describing the rationale behind the interface and the plan for MMTk integration should be in this [design document](https://docs.google.com/document/d/1v0jtSrIpdEDNOxj5S9g1jPqSpuAkNWhr_T8ToFC9RLI/edit) (feedback is welcome at this stage!). ## TODO - [x] Ensure functions in `gc-interface.h` are only declared in this header. - [x] Add allocation fast-path & codegen write-barriers into the interface.
Prelude to the MMTk integration.
Creates an interface header specifying the functions that a third-party GC must implement to plug into Julia, and also splits the stock Julia GC implementation into a separate file
gc-stock.c
.In the future, we'll include a few pre-processor guards to ensure some of these files are not compiled if MMTk is enabled.
A WIP design document describing the rationale behind the interface and the plan for MMTk integration should be in this design document (feedback is welcome at this stage!).
TODO
gc-interface.h
are only declared in this header.