Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Integer overflow checks are disabled by default in release builds, the author noted they were explicitly enabled in this project for additional safety.

(This is just for the normal operators, if you use e.g. checked_add() or wrapping_add() then you can be explicit about what behavior you want.)

[edit: oops, the overflow checks were only enabled for a separate test, see note from the author below]



It's worth observing that signed integer overflow is undefined in C but defined in Rust, which can impose an additional cost.

C: https://godbolt.org/z/CDha8-

Rust: https://godbolt.org/z/DlN3uf


No, we don't run with overflow checks by default; the overflow check performance analysis is a separate test.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: