Skip to content

Commit 32e4810

Browse files
committed
Merge branch 'master' of https://github.com/unitycontainer/container into v5.x
2 parents 0287642 + c32f372 commit 32e4810

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/Storage/HashRegistry.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ public HashRegistry(int capacity)
3535
Buckets = new int[size];
3636
Entries = new Entry[size];
3737

38+
#if !NET40
3839
unsafe
3940
{
4041
fixed (int* bucketsPtr = Buckets)
4142
{
4243
int* ptr = bucketsPtr;
4344
var end = bucketsPtr + Buckets.Length;
44-
while (ptr < end) *ptr++ = -1;
45+
while (ptr < end) *ptr++ = -1;
4546
}
4647
}
48+
#else
49+
for(int i = 0; i < Buckets.Length; i++)
50+
Buckets[i] = -1;
51+
#endif
4752
}
4853

4954
public HashRegistry(int capacity, LinkedNode<string, IPolicySet> head)

src/Storage/Registrations.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public Registrations(int capacity)
3535
Buckets = new int[size];
3636
Entries = new Entry[size];
3737

38+
#if !NET40
3839
unsafe
3940
{
4041
fixed (int* bucketsPtr = Buckets)
@@ -44,6 +45,10 @@ public Registrations(int capacity)
4445
while (ptr < end) *ptr++ = -1;
4546
}
4647
}
48+
#else
49+
for(int i = 0; i < Buckets.Length; i++)
50+
Buckets[i] = -1;
51+
#endif
4752
}
4853

4954
public Registrations(int capacity, LinkedNode<Type, IRegistry<string, IPolicySet>> head)

0 commit comments

Comments
 (0)