| 136 | } |
| 137 | |
| 138 | void bioCreateLazyFreeJob(lazy_free_fn free_fn, int arg_count, ...) { |
| 139 | va_list valist; |
| 140 | /* Allocate memory for the job structure and all required |
| 141 | * arguments */ |
| 142 | struct bio_job *job = zmalloc(sizeof(*job) + sizeof(void *) * (arg_count)); |
| 143 | job->free_fn = free_fn; |
| 144 | |
| 145 | va_start(valist, arg_count); |
| 146 | for (int i = 0; i < arg_count; i++) { |
| 147 | job->free_args[i] = va_arg(valist, void *); |
| 148 | } |
| 149 | va_end(valist); |
| 150 | bioSubmitJob(BIO_LAZY_FREE, job); |
| 151 | } |
| 152 | |
| 153 | void bioCreateCloseJob(int fd) { |
| 154 | struct bio_job *job = zmalloc(sizeof(*job)); |
no test coverage detected