Skip to content

Commit e437321

Browse files
author
LoneWandererProductions
committed
Cleanup a bit
1 parent d5a702b commit e437321

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

MemoryManager.Core/BlobManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public void Compact()
258258
unsafe
259259
{
260260
// Copy complete physical layout block footprints concurrently
261-
System.Buffer.MemoryCopy(
261+
Buffer.MemoryCopy(
262262
(void*)(_buffer + srcPhysicalOffset),
263263
(void*)(_buffer + destPhysicalOffset),
264264
physicalSize,

MemoryManager.Lanes/OneWayLane.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public unsafe bool MoveFromFastToSlow(MemoryHandle fastHandle)
102102
var slowPtr = _slowLane.Resolve(slowHandle);
103103

104104
// Direct unmanaged copy
105-
System.Buffer.MemoryCopy(
105+
Buffer.MemoryCopy(
106106
(void*)fastPtr,
107107
(void*)slowPtr,
108108
fastEntry.Size, // Destination capacity limit

MemoryManager/MemoryArena.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public AllocationEntry GetEntry(MemoryHandle handle)
123123
{
124124
if (handle.IsInvalid) throw new InvalidOperationException("Invalid handle");
125125

126-
lock (_lock) // FIX: Thread synchronization safeguard added for background sweeps
126+
lock (_lock)
127127
{
128128
return handle.Id > 0
129129
? FastLane.GetEntry(handle)
@@ -152,7 +152,7 @@ public void TickFrame()
152152
/// </summary>
153153
public void MoveFastToSlow(MemoryHandle fastHandle)
154154
{
155-
lock (_lock) // FIX: Thread-safety added to prevent mid-flight pointer invalidation
155+
lock (_lock)
156156
{
157157
FastLane.OneWayLane?.MoveFromFastToSlow(fastHandle);
158158
}
@@ -167,7 +167,7 @@ public void MoveFastToSlow(MemoryHandle fastHandle)
167167
/// <exception cref="System.OutOfMemoryException">Not enough space in FastLane to move from SlowLane.</exception>
168168
public unsafe MemoryHandle MoveSlowToFast(MemoryHandle slowHandle)
169169
{
170-
lock (_lock) // FIX: Fully synchronized layout transfer boundary
170+
lock (_lock)
171171
{
172172
if (slowHandle.IsInvalid || slowHandle.Id >= 0)
173173
throw new ArgumentException("Handle must be a valid SlowLane handle (negative ID).");
@@ -180,8 +180,7 @@ public unsafe MemoryHandle MoveSlowToFast(MemoryHandle slowHandle)
180180

181181
var fastHandle = FastLane.Allocate(size, slowEntry.Priority, slowEntry.Hints, null, CurrentFrame);
182182

183-
// FIX: Specified System namespace to clear structural ambiguous compilation errors
184-
System.Buffer.MemoryCopy(
183+
Buffer.MemoryCopy(
185184
(void*)(SlowLane.Buffer + slowEntry.Offset),
186185
(void*)FastLane.Resolve(fastHandle),
187186
size,
@@ -267,7 +266,7 @@ public unsafe void BulkSet<T>(MemoryHandle handle, ReadOnlySpan<T> source) where
267266
// 3. Execute bitwise copy while holding the system lockout lock
268267
fixed (T* srcPtr = source)
269268
{
270-
System.Buffer.MemoryCopy(srcPtr, dest, entry.Size, requiredSize);
269+
Buffer.MemoryCopy(srcPtr, dest, entry.Size, requiredSize);
271270
}
272271
}
273272
}
@@ -424,7 +423,7 @@ private void CheckPolicies()
424423
{
425424
if (!_config.EnableAutoCompaction) return;
426425

427-
// FIX: Consolidated and streamlined dual-threshold checks into unified sequential evaluation pass
426+
// Consolidated and streamlined dual-threshold checks into unified sequential evaluation pass
428427
var usage = FastLane.UsagePercentage();
429428
if (usage >= _config.CompactionThreshold || usage > _config.FastLaneUsageThreshold)
430429
{

0 commit comments

Comments
 (0)