Skip to content

Commit 7ba945e

Browse files
committed
Add missing dummy handle host pointer helper.
1 parent b63ea4f commit 7ba945e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/mock/ur_mock_helpers.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ template <class T> inline T createDummyHandle(size_t Size = 0) {
4141
return reinterpret_cast<T>(DummyHandlePtr);
4242
}
4343

44+
// Allocates a dummy handle of type T with support of reference counting
45+
// and associates it with the provided Data.
46+
template <class T> inline T createDummyHandleWithData(unsigned char *Data) {
47+
auto DummyHandlePtr = new dummy_handle_t_(Data);
48+
return reinterpret_cast<T>(DummyHandlePtr);
49+
}
50+
4451
// Decrement reference counter for the handle and deallocates it if the
4552
// reference counter becomes zero
4653
template <class T> inline void releaseDummyHandle(T Handle) {

0 commit comments

Comments
 (0)