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