mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Fix alignment to be based on starting address
Related-To: LOCI-2342 Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a481c28e55
commit
a1036ecc75
@@ -76,7 +76,8 @@ class HeapAllocator {
|
||||
pLeftBound += sizeToAllocate;
|
||||
}
|
||||
} else {
|
||||
const uint64_t misalignment = pRightBound - alignDown(pRightBound, alignment);
|
||||
const uint64_t pStart = pRightBound - sizeToAllocate;
|
||||
const uint64_t misalignment = pStart - alignDown(pStart, alignment);
|
||||
if (pLeftBound + sizeToAllocate + misalignment <= pRightBound) {
|
||||
if (misalignment) {
|
||||
pRightBound -= misalignment;
|
||||
|
||||
Reference in New Issue
Block a user