| 637 | } |
| 638 | |
| 639 | bool PleTable::issue(const uint32_t* rows16) { |
| 640 | std::lock_guard<std::recursive_mutex> lk(impl_->mu); |
| 641 | wait_prefetches(); |
| 642 | std::memcpy(impl_->rows, rows16, sizeof impl_->rows); |
| 643 | if (impl_->mode == PleIo::Direct) { |
| 644 | if (impl_->pending) return false; // one token in flight per table |
| 645 | impl_->ticket = impl_->reader.issue(impl_->rows, PLE_N_HEADS, impl_->raw); |
| 646 | impl_->pending = true; |
| 647 | return true; |
| 648 | } |
| 649 | #if defined(_WIN32) |
| 650 | if (impl_->data != nullptr && g_ple_prefetch) { |
| 651 | WIN32_MEMORY_RANGE_ENTRY ranges[PLE_N_HEADS]; |
| 652 | ULONG_PTR n = 0; |
| 653 | for (int h = 0; h < PLE_N_HEADS; ++h) { |
| 654 | if (rows16[h] >= impl_->n_rows) continue; |
| 655 | ranges[n].VirtualAddress = (PVOID) (impl_->data + (size_t) rows16[h] * impl_->rb); |
| 656 | ranges[n].NumberOfBytes = impl_->rb; |
| 657 | ++n; |
| 658 | } |
| 659 | if (n > 0) (void) PrefetchVirtualMemory(GetCurrentProcess(), n, ranges, 0); |
| 660 | } |
| 661 | #endif |
| 662 | impl_->pending = true; |
| 663 | return true; |
| 664 | } |
| 665 | |
| 666 | bool PleTable::collect(float* out2560, std::string& err) { |
| 667 | std::lock_guard<std::recursive_mutex> lk(impl_->mu); |
no test coverage detected