ipopt-rs icon indicating copy to clipboard operation
ipopt-rs copied to clipboard

Zero out values in ipopt callbacks

Open elrnv opened this issue 5 years ago • 0 comments

Currently, the callback interface is not 100% safe in a sense that the caller may potentially cause UB if the output slices in the objective and derivative callbacks are not initialized completely.

Since these callbacks can potentially be called often we probably would want to avoid doing additional memory writes to zero out the memory all the time, but it may be possible to expose an (additional) api that takes a slice of MaybeUninit, and outputs the same slice as initialized, letting the caller call assume_init explicitly.

elrnv avatar Oct 23 '19 20:10 elrnv