Bläddra i källkod

Unknown variable in SpanAllocator::Find (#1274)

MSVC is very forgiving of crimes committed in templated functions
and methods of templated classes that never actually get instantiated.
Consequently, the fact that the public variant of Find in SpanAllocator
referenced an unknown variable, seemingly as a copy paste error
was left unnoted. Other compilers are not so magnanimous.

The call to the private version of Find() takes an iterator. The
public Find() searches through the known spans to find the one just
past the range requested by the current pos and size. If it reaches
the end, then the span can be placed at the end safely. If it
fits before some other span, overlap needs to be checked. If the
new span would overlap it's neighbor, another location is needed.
It makes sense to start looking for that location after the end
of the neighbor whose span you just treaded on. So passing the
next iterator into the private Find() makes sense.
Greg Roth 7 år sedan
förälder
incheckning
99bbd867d5
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      include/dxc/HLSL/DxilSpanAllocator.h

+ 1 - 1
include/dxc/HLSL/DxilSpanAllocator.h

@@ -58,7 +58,7 @@ public:
     auto next = m_Spans.lower_bound(Span(nullptr, pos, end));
     if (next == m_Spans.end() || end < next->start)
       return true;  // it fits here
-    return Find(size, result.first, pos, align);
+    return Find(size, next, pos, align);
   }
 
   // allocate element size in first available space, returns false on failure