File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,8 @@ struct Slab {
226226 // We attempt to place these next to each other.
227227 // TODO: We should coalesce these bits and use the result of `fetch_or` to
228228 // search for free bits in parallel.
229- for (uint64_t mask = ~0ull ; mask; mask = gpu::ballot (lane_mask, !result)) {
229+ for (uint64_t mask = lane_mask; mask;
230+ mask = gpu::ballot (lane_mask, !result)) {
230231 uint32_t id = impl::lane_count (uniform & mask);
231232 uint32_t index =
232233 (gpu::broadcast_value (lane_mask, impl::xorshift32 (state)) + id) %
@@ -334,10 +335,10 @@ template <typename T> struct GuardPtr {
334335 cpp::MemoryOrder::RELAXED,
335336 cpp::MemoryOrder::RELAXED)) {
336337 count = cpp::numeric_limits<uint64_t >::max ();
337- T *mem = reinterpret_cast <T *>( impl::rpc_allocate (sizeof (T) ));
338- if (!mem )
338+ void *raw = impl::rpc_allocate (sizeof (T));
339+ if (!raw )
339340 return nullptr ;
340- new (mem ) T (cpp::forward<Args>(args)...);
341+ T *mem = new (raw ) T (cpp::forward<Args>(args)...);
341342
342343 cpp::atomic_thread_fence (cpp::MemoryOrder::RELEASE);
343344 ptr.store (mem, cpp::MemoryOrder::RELAXED);
You can’t perform that action at this time.
0 commit comments