don't malloc/memset posix accessor buffer

it's relatively small and fits on the stack nicely, and we don't need it
initialized either.
This commit is contained in:
pennae 2023-12-10 10:34:55 +01:00
parent b78e77b34c
commit f9aee2f2c4

View file

@ -25,7 +25,7 @@ void PosixSourceAccessor::readFile(
off_t left = st.st_size;
std::vector<unsigned char> buf(64 * 1024);
std::array<unsigned char, 64 * 1024> buf;
while (left) {
checkInterrupt();
ssize_t rd = read(fd.get(), buf.data(), (size_t) std::min(left, (off_t) buf.size()));