Skip to content

Commit

Permalink
Add Unsafe example from .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Dec 16, 2024
1 parent 3e37a0d commit 3721f70
Show file tree
Hide file tree
Showing 5 changed files with 833 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ The `<InlineIL />` element in `FodyWeavers.xml` accepts the following attributes

## Examples

- A [reimplementation of the `System.Runtime.CompilerServices.Unsafe` class](src/InlineIL.Examples/UnsafeNet6.cs) using InlineIL is provided as an example (compare to [the original IL code](https://github.com/dotnet/runtime/blob/release/6.0/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il) in .NET 6).
- Two implementations of the `System.Runtime.CompilerServices.Unsafe` class are provided as examples:
- [.NET 6 version](src/InlineIL.Examples/UnsafeNet6.cs) (compare to [the original IL code](https://github.com/dotnet/runtime/blob/release/6.0/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il)).
- [.NET 9 version](src/InlineIL.Examples/UnsafeNet9.cs), with newer API.

- Unit tests can also serve as examples of API usage. See [verifiable](https://github.com/ltrzesniewski/InlineIL.Fody/tree/master/src/InlineIL.Tests.AssemblyToProcess) and [unverifiable](https://github.com/ltrzesniewski/InlineIL.Fody/tree/master/src/InlineIL.Tests.UnverifiableAssemblyToProcess) test cases.

Expand Down
2 changes: 1 addition & 1 deletion src/InlineIL.Examples/InlineIL.Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 3721f70

Please sign in to comment.