Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[mini] Use alloca for runtime_invoke retval buffer #58978

Merged
merged 2 commits into from
Sep 12, 2021

Conversation

lambdageek
Copy link
Member

Fixes #58957
Related to #58215 which was attempting to
fix #58190

@ghost
Copy link

ghost commented Sep 11, 2021

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #58957
Related to #58215 which was attempting to
fix #58190

Author: lambdageek
Assignees: -
Labels:

area-VM-meta-mono

Milestone: -

gboolean retval_malloc = FALSE;
gpointer retval_ptr;
guint8 retval [MONO_SIZEOF_DYN_CALL_RET_BUF];
int32_t retval_size = MONO_SIZEOF_DYN_CALL_RET_BUF;
Copy link
Member

Choose a reason for hiding this comment

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

Could the initial size be SIZEOF_VOID_P in order to avoid unnecessary stack allocation ?

In the common case we use the return buffer just to hold a pointer to
the return value
@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1227523946

@lambdageek lambdageek merged commit 206dba7 into dotnet:main Sep 12, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@lambdageek lambdageek deleted the fix-gh-58957 branch March 19, 2022 16:45
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mono] Possible GC hole in runtime invoke Mono: handle structs larger than 256 bytes correctly
3 participants