-
Notifications
You must be signed in to change notification settings - Fork 0
MSVC EH: Partial x64 support #4
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
Conversation
…g std::terminate remove vcruntime hacks when converting to exception to error, do not rethrow if the catch handles errors, too
f28d365 to
3493e19
Compare
|
I've fixed a few bugs and added some comments... |
|
Realized just now, that this PR is against my branch ;-) |
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.
This function already exists as rt.util.container.xmalloc.
|
Oh right - that's too bad. The GC won't help here either, right? So the only 2 solutions are either building these structs at compile time or pre-allocating a reasonable chunk of memory and dying with an OutOfMemoryError (or just terminating) in case it doesn't suffice, correct? :/ And all of this because of these crappy 32-bit offsets for x64, dammit... |
|
I think the GC could work, but the base pointer needs to be saved in the exception stack, too. That would prevent premature collection. |
D exceptions are not created while being thrown, so it needs the dynamic type to generate the _ThrowInfo. It would have to be added to the ClassInfo or similar where it's accessible via virtual dispatch. In C++, it is just created with the throw statement. |
That's what I meant - a TypeDescriptor, CatchableType, CatchableTypeArray and _ThrowInfo for each |
I only just now realized what you meant - not freeing the previous block when growing. That sounds like the most straight-forward approach to me, and the total memory consumption should be manageable, especially in times where even smartphones have Gigabytes of memory. ;) |
f0d795f to
7484da5
Compare
Everything starting from
struct FrameInfo, especially the inline assembly parts, still needs to be done.Not tested at all, except for basic compilability. :]