hlsf wrong alloc solved

This commit is contained in:
Youmu Liu
2025-11-24 17:00:10 +08:00
parent 67a4ac385f
commit b7b960a604
12 changed files with 357 additions and 290 deletions
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="HLSFAllocator.Alloc"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -74,7 +74,6 @@ namespace StgSharp.HighPerformance.Memory
SliceMemory(handle, (segmentIndex + 1) * levelSizeArray[level]);
}
handle->State = EntryState.Allocated;
Console.WriteLine($"handle alloced at {handle->Position}");
return new hlsfHandle(handle, size);
}
@@ -213,7 +212,8 @@ namespace StgSharp.HighPerformance.Memory
_spareMemory->Position = newPos;
BucketNode* b = (BucketNode*)handle->Position;
b->EntryRef = handle;
PushLevel(handle->Level, DetermineSegmentIndex((uint)blockSize, handle->Level), b);
// PushLevel(handle->Level, DetermineSegmentIndex((uint)blockSize, handle->Level), b);
// update position linked list
handle->NextNear = (ulong)_spareMemory;