-
Notifications
You must be signed in to change notification settings - Fork 377
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
Experiment to factor out GC into its own project #3437
Conversation
b0221ef
to
bd5a856
Compare
bd5a856
to
960aa8d
Compare
8dab618
to
2d58a92
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.
Thank your the POC, however, I would be against of moving the GC to other project, here's why:
nativelib
is basicallyScala Native Runtime
with the GC as it's integral component. It would be impossible to run ScalaNative without GC and I don't think at any point we would be able to eliminate it completlly.- Moving the GC to seperate project does not fix or improve anything yet. One possibility would be to have a distinct project for each GC implementation. However, doing so is also tricky and not promissing. The NativeConfig is applied to far in the build to be able to efficently resolve GC dependencies (jars) based on provided config without integrating with each build tool. On the other hand if we'd move it to normal
libraryDependenices
of sbt or other build tool, then we cannot control what exactly would be present on class path, so we might end up with 2 GCs being compiled and failing to link due to duplicate symbols. - I've seen that you needed to move SafeZone to
gclib
. This change on it's own seems wrong, becouse this type has nothing to do with the GC, beside using it's API to specify memory ranges which shall be scanned. It shall always be simply a part of runtime library.
If at some point, we find a problem for which moving out GC would bring the improvement then your change would be a good place to start with. Once again thank you for your effort and experimenting with the code.
See #3555 (comment) |
In general, I was thinking that GC and unwind could be factored out into there own project. Of course code that is intertwined is not great. The way the depends are done is a bit strange but I was only trying to get something to work.
This is not ready for prime time and we would have to think through several issues.
platform/unwind.h
so it is duplicated - this I don't think we should do this and the offending code should be removed. How we could doOutOfMemoryException
well is not determined but this isn't it.GC.scala
code uses basic types. The only way I could see this working is to have a basic type library that is used by nativelib, gclib, and others. We might be able to think about what is runtime only or public - I know this is pretty mushy right now.GC.scala
directly so this dependency doesn't work. Not sure what could be done here.Note: this has tons of changes as it is based on the other build PR. Some of the ability to reorganize here is based on the that PR for convenience. Probably doesn't need to be but ...
Note: Rebased on top of #3389