Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Fix ProjectN test regressions - #1393

Merged
jkotas merged 1 commit into
dotnet:masterfrom
jkotas:fixes
Jun 10, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
jkotas:fixes

Conversation

@jkotas

@jkotas jkotas commented Jun 10, 2016

Copy link
Copy Markdown
Member

No description provided.

@jkotas
jkotas merged commit 5e47673 into dotnet:master Jun 10, 2016
@jkotas
jkotas deleted the fixes branch June 10, 2016 22:21
jkotas pushed a commit that referenced this pull request Jun 14, 2017
…et_Target.

CR: JKotas, FadiM, DavidWr

At some moment the CallConverterThunk code took dependency on the blittable check missing in GCHandle.set_Target (change 1566458), so we had to place that check under "#if CORERT" (#1393).  This change enables the check and introduces the UnsafeGCHandle structure to use in the CallConverterThunk code.

UnsafeGCHandle is a faster version of the GCHandle structure with the following differences:
* The constructor assumes the handle type is valid; no range check is performed.
* The pinned flag is not stored in the _handle field.
* The Target getter and setter assume the UnsafeGCHandle has been allocated.
* No blittable check is performed when allocating a pinned UnsafeGCHandle or setting its target.
* The GetRawTargetAddress method returns the raw address of the target (the pointer to its m_pEEType field).
* The Free method is not thread-safe and does not throw if the UnsafeGCHandle has not been allocated or has been already freed.

Also avoid the native runtime call in release builds in the RuntimeImports.RhHandleGet method and Runtime.Base's version of the UnsafeGCHandle.get_Target method (in debug builds the runtime performs additional checks).

[tfs-changeset: 1661633]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants