Skip to content

[marshal] Cleanup dead ifdefs - #78435

Merged
lambdageek merged 6 commits into
dotnet:mainfrom
lambdageek:remove-marshal-unused-code
Nov 16, 2022
Merged

lambdageek merged 6 commits into
dotnet:mainfrom
lambdageek:remove-marshal-unused-code

Conversation

@lambdageek

@lambdageek lambdageek commented Nov 16, 2022 •

Copy link
Copy Markdown
Member
  1. The DISABLE_NONBLITTABLE define was a previous attempt at partitioning the marshaling into a simple version that just supports blittable types and the full legacy marshaller. It was never used in production.

  2. The ENABLE_ILGEN was used previously in configurations where runtime codegen was not available to save some space by excluding support for emitting IL at runtime (needed for marshaling, fast managed allocators in sgen, etc). It also used to emit the ilgen support code into a separate static library that could optionallly be linked into the runtime, and enabled with an appropriate API call (mono_marshal_ilgen_init). This define is now on by default and the API function is a no-op.

  3. Mark a collection of mono_win32_compat_ functions with MONO_RT_EXTERNAL_ONLY and move them to external-only.c (these were used in mono/mono dllmap support to provide some common kernel32 functions on non-Windows)

  4. Remove MonoMarshalILgenCallbacks in marshal-ilgen.c - just do direct calls to the _ilgen helper functions

Fixes #78422

This was a previous attempt at supporting only blittlable marshaling.
It is not used on any platform.

The current approach is to build a "lightweight" version marshaling
that only works with blittable types, and a separate runtime component
for legacy marshaling
It is not used anymore since ilgen is always in the runtime
@lambdageek

Copy link
Copy Markdown
Member Author

@naricc first stab at cleaning up now that the component is finally in

@lambdageek

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

These were used with mono/mono dllmaps to provide common kernel32 functions
on non-Windows.  Keep them around since they're marked MONO_API, but
don't use them in the runtime
Instead of doing an indirect call through `get_marshal_cb()`, just
call the relevant `_ilgen` functions directly.  They're all
implementation details of the legacy marshaller.
@lambdageek
lambdageek force-pushed the remove-marshal-unused-code branch from 1cc3c47 to ba31afc Compare November 16, 2022 03:01
@lambdageek

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@SamMonoRT

Copy link
Copy Markdown
Member

Fixes #78422

@lambdageek

Copy link
Copy Markdown
Member Author

tvOS failures are unrelated

@lambdageek
lambdageek merged commit bc75946 into dotnet:main Nov 16, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2022
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.

[MONO][Marshal] Remove unused marshal-noilgen code

3 participants