mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
Implement fs::file::write_gather (Vectored I/O)
This commit is contained in:
parent
31994dd3b2
commit
447029a700
3 changed files with 64 additions and 6 deletions
|
@ -265,15 +265,18 @@ void spu_cache::add(const std::vector<u32>& func)
|
|||
return;
|
||||
}
|
||||
|
||||
// Allocate buffer
|
||||
const auto buf = std::make_unique<be_t<u32>[]>(func.size() + 1);
|
||||
be_t<u32> size = ::size32(func) - 1;
|
||||
be_t<u32> addr = func[0];
|
||||
|
||||
buf[0] = ::size32(func) - 1;
|
||||
buf[1] = func[0];
|
||||
std::memcpy(buf.get() + 2, func.data() + 1, func.size() * 4 - 4);
|
||||
const fs::iovec_clone gather[3]
|
||||
{
|
||||
{&size, sizeof(size)},
|
||||
{&addr, sizeof(addr)},
|
||||
{func.data() + 1, func.size() * 4 - 4}
|
||||
};
|
||||
|
||||
// Append data
|
||||
m_file.write(buf.get(), func.size() * 4 + 4);
|
||||
m_file.write_gather(gather, 3);
|
||||
}
|
||||
|
||||
void spu_cache::initialize()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue