1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

(native) Register fixed fd:s for a nice io_uring speed boost

This commit is contained in:
Viktor Lofgren
2025-08-16 13:48:11 +02:00
parent a7a18ced2e
commit 6953d65de5

View File

@@ -30,8 +30,7 @@ io_uring* initialize_uring_single_file(int queue_size, int fd) {
// Register the file descriptor with io_uring to speed it up fairly significantly
int *fds = (int*) malloc(sizeof(int));
// We need to duplicate the file descriptor because io_uring grabs ownership of it
fds[0] = dup(fd);
fds[0] = fd;
ret = io_uring_register_files(ring, fds, 1);
if (ret < 0) {