Align mmaped bo address properly

Change-Id: I010f6619821ad715bb6f0e9640be19943a45abd8
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-10-12 15:11:40 +02:00
committed by sys_ocldev
parent eb8f5fa301
commit 8892ee3f1f
6 changed files with 25 additions and 12 deletions

View File

@@ -17,6 +17,9 @@ extern off_t lseekReturn;
extern std::atomic<int> lseekCalledCount;
inline void *mmapMock(void *addr, size_t length, int prot, int flags, int fd, off_t offset) noexcept {
if (addr) {
return addr;
}
void *ptr = nullptr;
if (length > 0) {
ptr = alignedMalloc(length, MemoryConstants::pageSize64k);