Files
compute-runtime/runtime/os_interface/linux/drm_limited_range.h
Jaime Arteaga b98b51b0d9 Move ptr.h to core folder
Change-Id: Icf0db7c767b2b1ea44fccc02b135f0f6c1f78c8f
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2019-05-29 00:11:34 -07:00

35 lines
761 B
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "core/helpers/basic_math.h"
#include "core/helpers/ptr_math.h"
#include "runtime/helpers/aligned_memory.h"
#include "runtime/utilities/heap_allocator.h"
#include <memory>
#include <stdint.h>
#include <sys/mman.h>
namespace NEO {
class AllocatorLimitedRange {
public:
AllocatorLimitedRange(uint64_t base, uint64_t size);
AllocatorLimitedRange() = delete;
~AllocatorLimitedRange() = default;
uint64_t allocate(size_t &size);
void free(uint64_t ptr, size_t size);
uint64_t getBase() const;
protected:
uint64_t base = 0;
uint64_t size = 0;
std::unique_ptr<HeapAllocator> heapAllocator;
};
} // namespace NEO