Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add !!( ) to branch predictor hints to force 1 or 0 result
This makes it so we can program as usual and no issues result from for example: if (MVM_LIKELY(my_var)) Turns into __builtin_expect(myvar, 1). But in most cases my_var isn't 1 even though it evaluates as true. Make we instead turn it into __builtin_expect(!!myvar, 1) which will be correct in all cases where myvar is not zero. The compiler may have been smart enough to figure this out before or it may not have been, but this resolves warnings of type issues when using a pointer in a conditional and we can be more sure that MVM_LIKELY is operating properly.
- Loading branch information