1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: do not allow uninitialized function pointers

This commit is contained in:
Alexander Medvednikov
2023-08-03 21:06:32 +03:00
parent 453137384e
commit 428fd7f57f
28 changed files with 110 additions and 64 deletions

View File

@ -24,9 +24,15 @@ mut:
pub type ThreadCB = fn (mut p PoolProcessor, idx int, task_id int) voidptr
fn empty_cb(mut p PoolProcessor, idx int, task_id int) voidptr {
unsafe {
return nil
}
}
pub struct PoolProcessorConfig {
maxjobs int
callback ThreadCB
callback ThreadCB = empty_cb
}
// new_pool_processor returns a new PoolProcessor instance.