Skip to content

Commit 3f5f568

Browse files
authored
Merge pull request #1510 from kbenzie/benie/cuda-fix-wrapper-escape
Fix Coverity wrapper escape issue
2 parents fe9a05e + 6027c6b commit 3f5f568

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/adapters/cuda/memory.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct BufferMem {
3434
MapMem(nullptr) {}
3535

3636
BufferMap(size_t MapSize, size_t MapOffset, ur_map_flags_t MapFlags,
37-
std::unique_ptr<unsigned char[]> &MapMem)
37+
std::unique_ptr<unsigned char[]> &&MapMem)
3838
: MapSize(MapSize), MapOffset(MapOffset), MapFlags(MapFlags),
3939
MapMem(std::move(MapMem)) {}
4040

@@ -105,7 +105,7 @@ struct BufferMem {
105105
auto MapMem = std::make_unique<unsigned char[]>(MapSize);
106106
MapPtr = MapMem.get();
107107
PtrToBufferMap.insert(
108-
{MapPtr, BufferMap(MapSize, MapOffset, MapFlags, MapMem)});
108+
{MapPtr, BufferMap(MapSize, MapOffset, MapFlags, std::move(MapMem))});
109109
} else {
110110
/// However, if HostPtr already has valid memory (e.g. pinned allocation),
111111
/// we can just use that memory for the mapping.

0 commit comments

Comments
 (0)