static auto read_async_direct(const char* path, size_t buf_size) { auto fd = safe_open(path, O_RDONLY | O_DIRECT | O_NOATIME).get(); auto buf1 = allocate_aligned(4096, buf_size); auto buf2 = allocate_aligned(4096, buf_size); auto count = async_read_loop(fd, buf1.get(), buf2.get(), buf_size); ::close(fd); return count; }
void test_allocate_aligned(void) { Object *o = allocate_aligned(mc, 34, 64); assert( (63 & (long)o) == 0); deallocate_aligned(mc, o, 34, 64); }