Skip to content

Commit

Permalink
Updating internal Pure.DI to 2.1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed May 20, 2024
1 parent 77e6968 commit ce8942f
Show file tree
Hide file tree
Showing 41 changed files with 301 additions and 296 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<InternalVersion>2.1.19</InternalVersion>
<InternalVersion>2.1.20</InternalVersion>
<BasePackageId>Pure.DI</BasePackageId>
<LangVersion>latest</LangVersion>
<BaseTargetFramework>net8.0</BaseTargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion readme/FuncDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ partial class Func
[MethodImpl(MethodImplOptions.AggressiveInlining)]
() =>
{
var localValue0 = new Service3(new Service4(), new Service4());
IService3 localValue0 = new Service3(new Service4(), new Service4());
return localValue0;
});
return new CompositionRoot(new Service1(new Service2Func(perBlockFunc10)), new Service2Func(perBlockFunc10), new Service2Func(perBlockFunc10), new Service2Func(perBlockFunc10), new Service3(new Service4(), new Service4()), new Service4(), new Service4());
Expand Down
19 changes: 12 additions & 7 deletions readme/SingletonDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ partial class Singleton
{
private readonly Singleton _root;

private Service1? _scopedService137;
private Service4? _scopedService440;
private Service1? _scopedService140;
private Service4? _scopedService443;

public Singleton()
{
Expand All @@ -79,17 +79,22 @@ partial class Singleton
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public partial CompositionRoot TestPureDIByCR()
{
if (_scopedService440 == null)
if (_scopedService443 == null)
{
_scopedService440 = new Service4();
_scopedService443 = new Service4();
}

if (_scopedService137 == null)
if (_scopedService140 == null)
{
_scopedService137 = new Service1(new Service2(new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!)));
if (_scopedService443 == null)
{
_scopedService443 = new Service4();
}

_scopedService140 = new Service1(new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)));
}

return new CompositionRoot(_scopedService137!, new Service2(new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!)), new Service2(new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!)), new Service2(new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!), new Service3(_scopedService440!, _scopedService440!)), new Service3(_scopedService440!, _scopedService440!), _scopedService440!, _scopedService440!);
return new CompositionRoot(_scopedService140!, new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service3(_scopedService443!, _scopedService443!), _scopedService443!, _scopedService443!);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
24 changes: 12 additions & 12 deletions readme/accumulators.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ partial class Composition
private readonly Composition _root;
private readonly object _lock;

private XyzDependency? _singletonXyzDependency38;
private XyzDependency? _singletonXyzDependency41;

public Composition()
{
Expand All @@ -68,36 +68,36 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var accumulator42 = new MyAccumulator();
var accumulator45 = new MyAccumulator();
AbcDependency perBlockAbcDependency4 = new AbcDependency();
if (_root._singletonXyzDependency38 == null)
if (_root._singletonXyzDependency41 == null)
{
lock (_lock)
{
if (_root._singletonXyzDependency38 == null)
if (_root._singletonXyzDependency41 == null)
{
XyzDependency _singletonXyzDependency38Temp;
_singletonXyzDependency38Temp = new XyzDependency();
accumulator42.Add(_singletonXyzDependency38Temp);
XyzDependency _singletonXyzDependency41Temp;
_singletonXyzDependency41Temp = new XyzDependency();
accumulator45.Add(_singletonXyzDependency41Temp);
Thread.MemoryBarrier();
_root._singletonXyzDependency38 = _singletonXyzDependency38Temp;
_root._singletonXyzDependency41 = _singletonXyzDependency41Temp;
}
}
}

AbcDependency transientAbcDependency3 = new AbcDependency();
lock (_lock)
{
accumulator42.Add(transientAbcDependency3);
accumulator45.Add(transientAbcDependency3);
}

Service transientService1 = new Service(transientAbcDependency3, _root._singletonXyzDependency38!, perBlockAbcDependency4);
Service transientService1 = new Service(transientAbcDependency3, _root._singletonXyzDependency41!, perBlockAbcDependency4);
lock (_lock)
{
accumulator42.Add(transientService1);
accumulator45.Add(transientService1);
}

return (transientService1, accumulator42);
return (transientService1, accumulator45);
}
}

Expand Down
28 changes: 14 additions & 14 deletions readme/async-disposable-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ partial class Composition: IDisposable, IAsyncDisposable
private object[] _disposables;
private int _disposeIndex;

private Dependency? _scopedDependency36;
private Dependency? _scopedDependency39;

public Composition()
{
Expand All @@ -113,19 +113,19 @@ partial class Composition: IDisposable, IAsyncDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
if (_scopedDependency36 == null)
if (_scopedDependency39 == null)
{
lock (_lock)
{
if (_scopedDependency36 == null)
if (_scopedDependency39 == null)
{
_scopedDependency36 = new Dependency();
_disposables[_disposeIndex++] = _scopedDependency36;
_scopedDependency39 = new Dependency();
_disposables[_disposeIndex++] = _scopedDependency39;
}
}
}

return new Service(_scopedDependency36!);
return new Service(_scopedDependency39!);
}
}

Expand All @@ -134,26 +134,26 @@ partial class Composition: IDisposable, IAsyncDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perResolveFunc43 = default(Func<Session>);
if (perResolveFunc43 == null)
var perResolveFunc46 = default(Func<Session>);
if (perResolveFunc46 == null)
{
lock (_lock)
{
if (perResolveFunc43 == null)
if (perResolveFunc46 == null)
{
perResolveFunc43 = new Func<Session>(
perResolveFunc46 = new Func<Session>(
[MethodImpl(MethodImplOptions.AggressiveInlining)]
() =>
{
Composition transientComposition2 = this;
var localValue51 = new Session(transientComposition2);
Session localValue51 = new Session(transientComposition2);
return localValue51;
});
}
}
}

return new Program(perResolveFunc43!);
return new Program(perResolveFunc46!);
}
}

Expand All @@ -167,7 +167,7 @@ partial class Composition: IDisposable, IAsyncDisposable
_disposeIndex = 0;
disposables = _disposables;
_disposables = new object[1];
_scopedDependency36 = null;
_scopedDependency39 = null;
}

while (disposeIndex-- > 0)
Expand Down Expand Up @@ -204,7 +204,7 @@ partial class Composition: IDisposable, IAsyncDisposable
_disposeIndex = 0;
disposables = _disposables;
_disposables = new object[1];
_scopedDependency36 = null;
_scopedDependency39 = null;
}

while (disposeIndex-- > 0)
Expand Down
16 changes: 8 additions & 8 deletions readme/async-disposable-singleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ partial class Composition: IDisposable, IAsyncDisposable
private object[] _disposables;
private int _disposeIndex;

private Dependency? _singletonDependency36;
private Dependency? _singletonDependency39;

public Composition()
{
Expand All @@ -79,19 +79,19 @@ partial class Composition: IDisposable, IAsyncDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
if (_root._singletonDependency36 == null)
if (_root._singletonDependency39 == null)
{
lock (_lock)
{
if (_root._singletonDependency36 == null)
if (_root._singletonDependency39 == null)
{
_root._singletonDependency36 = new Dependency();
_root._disposables[_root._disposeIndex++] = _root._singletonDependency36;
_root._singletonDependency39 = new Dependency();
_root._disposables[_root._disposeIndex++] = _root._singletonDependency39;
}
}
}

return new Service(_root._singletonDependency36!);
return new Service(_root._singletonDependency39!);
}
}

Expand All @@ -105,7 +105,7 @@ partial class Composition: IDisposable, IAsyncDisposable
_disposeIndex = 0;
disposables = _disposables;
_disposables = new object[1];
_singletonDependency36 = null;
_singletonDependency39 = null;
}

while (disposeIndex-- > 0)
Expand Down Expand Up @@ -142,7 +142,7 @@ partial class Composition: IDisposable, IAsyncDisposable
_disposeIndex = 0;
disposables = _disposables;
_disposables = new object[1];
_singletonDependency36 = null;
_singletonDependency39 = null;
}

while (disposeIndex-- > 0)
Expand Down
22 changes: 11 additions & 11 deletions readme/async-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Task<IService> GetMyServiceAsync(CancellationToken cancellationToken)
{
var perResolveFunc41 = default(Func<IService>);
var perResolveFunc44 = default(Func<IService>);
TaskScheduler transientTaskScheduler4 = TaskScheduler.Default;
TaskContinuationOptions transientTaskContinuationOptions3 = TaskContinuationOptions.None;
TaskCreationOptions transientTaskCreationOptions2 = TaskCreationOptions.None;
TaskFactory<IService> perBlockTaskFactory1;
{
var localCancellationToken10 = cancellationToken;
var localTaskCreationOptions11 = transientTaskCreationOptions2;
var localTaskContinuationOptions12 = transientTaskContinuationOptions3;
var localTaskScheduler13 = transientTaskScheduler4;
CancellationToken localCancellationToken10 = cancellationToken;
TaskCreationOptions localTaskCreationOptions11 = transientTaskCreationOptions2;
TaskContinuationOptions localTaskContinuationOptions12 = transientTaskContinuationOptions3;
TaskScheduler localTaskScheduler13 = transientTaskScheduler4;
perBlockTaskFactory1 = new TaskFactory<IService>(localCancellationToken10, localTaskCreationOptions11, localTaskContinuationOptions12, localTaskScheduler13);
}

if (perResolveFunc41 == null)
if (perResolveFunc44 == null)
{
lock (_lock)
{
if (perResolveFunc41 == null)
if (perResolveFunc44 == null)
{
perResolveFunc41 = new Func<IService>(
perResolveFunc44 = new Func<IService>(
[MethodImpl(MethodImplOptions.AggressiveInlining)]
() =>
{
var localValue14 = new Service(new Dependency());
IService localValue14 = new Service(new Dependency());
return localValue14;
});
}
Expand All @@ -84,8 +84,8 @@ partial class Composition

Task<IService> transientTask0;
{
var localFactory15 = perResolveFunc41!;
var localTaskFactory16 = perBlockTaskFactory1;
Func<IService> localFactory15 = perResolveFunc44!;
TaskFactory<IService> localTaskFactory16 = perBlockTaskFactory1;
transientTask0 = localTaskFactory16.StartNew(localFactory15);
}

Expand Down
24 changes: 12 additions & 12 deletions readme/auto-scoped.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ partial class Composition
private readonly Composition _root;
private readonly object _lock;

private Dependency? _scopedDependency36;
private Dependency? _scopedDependency39;

public Composition()
{
Expand All @@ -91,18 +91,18 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
if (_scopedDependency36 == null)
if (_scopedDependency39 == null)
{
lock (_lock)
{
if (_scopedDependency36 == null)
if (_scopedDependency39 == null)
{
_scopedDependency36 = new Dependency();
_scopedDependency39 = new Dependency();
}
}
}

return new Service(_scopedDependency36!);
return new Service(_scopedDependency39!);
}
}

Expand All @@ -111,34 +111,34 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perResolveFunc43 = default(Func<IService>);
if (perResolveFunc43 == null)
var perResolveFunc46 = default(Func<IService>);
if (perResolveFunc46 == null)
{
lock (_lock)
{
if (perResolveFunc43 == null)
if (perResolveFunc46 == null)
{
perResolveFunc43 = new Func<IService>(
perResolveFunc46 = new Func<IService>(
[MethodImpl(MethodImplOptions.AggressiveInlining)]
() =>
{
Composition transientComposition2 = this;
IService transientIService1;
{
var localBaseComposition53 = transientComposition2;
Composition localBaseComposition53 = transientComposition2;
// Creates a session
var localSession54 = new Composition(localBaseComposition53);
transientIService1 = localSession54.SessionRoot;
}

var localValue52 = transientIService1;
IService localValue52 = transientIService1;
return localValue52;
});
}
}
}

return new Program(perResolveFunc43!);
return new Program(perResolveFunc46!);
}
}
}
Expand Down
Loading

0 comments on commit ce8942f

Please sign in to comment.