File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -760,9 +760,9 @@ libreCudaStatus_t gpuFree(LibreCUcontext ctx, NvU64 virtualAddress) {
760
760
va_to_mem_handle.erase (virtualAddress);
761
761
// iterate in reverse order to exploit the fact that we use a bump allocator
762
762
// and the insertion position is indicative of the address magnitude
763
- for (auto it = hostMappedPtrs.end (); it > = hostMappedPtrs.begin (); -- it) {
763
+ for (auto it = hostMappedPtrs.rbegin (); it ! = hostMappedPtrs.rend (); ++ it) {
764
764
if (virtualAddress < it->second && virtualAddress >= it->first ) {
765
- hostMappedPtrs.erase (it );
765
+ hostMappedPtrs.erase (std::next (it). base () );
766
766
break ;
767
767
}
768
768
}
@@ -841,7 +841,7 @@ bool isHostMappedPtr(void *ptr) {
841
841
842
842
// iterate in reverse order to exploit the fact that we use a bump allocator
843
843
// and the insertion position is indicative of the address magnitude
844
- for (auto it = hostMappedPtrs.end (); it > = hostMappedPtrs.begin (); -- it) {
844
+ for (auto it = hostMappedPtrs.rbegin (); it ! = hostMappedPtrs.rend (); ++ it) {
845
845
if (va < it->second && va >= it->first ) {
846
846
return true ;
847
847
}
You can’t perform that action at this time.
0 commit comments