Skip to content

Commit 262b6cd

Browse files
.net 8 - memory #203
1 parent 8c2c56a commit 262b6cd

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

1_CS/Memory/DisposableSample/DisposableSample.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

1_CS/Memory/DisposableSample/SomeInnerResource.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ public SomeInnerResource() =>
55

66
public void Foo()
77
{
8-
if (disposedValue) throw new ObjectDisposedException(nameof(SomeInnerResource));
8+
ObjectDisposedException.ThrowIf(isDisposed, this);
99
Console.WriteLine($"{nameof(SomeInnerResource)}.{nameof(Foo)}");
1010
}
1111

12-
private bool disposedValue = false; // To detect redundant calls
12+
private bool isDisposed = false; // To detect redundant calls
1313

1414
protected virtual void Dispose(bool disposing)
1515
{
16-
if (!disposedValue)
16+
if (!isDisposed)
1717
{
1818
if (disposing)
1919
{
@@ -24,7 +24,7 @@ protected virtual void Dispose(bool disposing)
2424
Console.WriteLine("simulation to release native memory");
2525
// TODO: set large fields to null.
2626

27-
disposedValue = true;
27+
isDisposed = true;
2828
}
2929
}
3030

1_CS/Memory/PointerPlayground/PointerPlayground.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

1_CS/Memory/PointerPlayground2/PointerPlayground2.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

1_CS/Memory/QuickArray/QuickArray.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

1_CS/Memory/SpanSample/SpanSample.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

0 commit comments

Comments
 (0)