mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
This reverts commit 1ce2f9564a.
Related-To: NEO-2877
Change-Id: Id17e0bce560ed1d934412067f9e41d39c529018f
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
32 lines
813 B
C++
32 lines
813 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/os_interface/linux/drm_limited_range.h"
|
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
|
#include "runtime/os_interface/linux/allocator_helper.h"
|
|
|
|
using namespace NEO;
|
|
|
|
NEO::AllocatorLimitedRange::AllocatorLimitedRange(uint64_t base, uint64_t size) : base(base), size(size), heapAllocator(std::make_unique<HeapAllocator>(base, size)) {
|
|
}
|
|
|
|
uint64_t NEO::AllocatorLimitedRange::allocate(size_t &size) {
|
|
if (size >= this->size) {
|
|
return 0llu;
|
|
}
|
|
return this->heapAllocator->allocate(size);
|
|
}
|
|
|
|
void NEO::AllocatorLimitedRange::free(uint64_t ptr, size_t size) {
|
|
this->heapAllocator->free(ptr, size);
|
|
}
|
|
|
|
uint64_t NEO::AllocatorLimitedRange::getBase() const {
|
|
return base;
|
|
}
|