mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
Add branch prediction hint for mi_option_get
mi_option_get is called frequently in stress tests, and the patch adds extra hint to the compiler to emit instructions that will cause branch prediction to favour the "likely" side of a jump instruction.
This commit is contained in:
parent
7266e7006a
commit
3e9c953eea
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ static void mi_option_init(mi_option_desc_t* desc);
|
||||||
long mi_option_get(mi_option_t option) {
|
long mi_option_get(mi_option_t option) {
|
||||||
mi_assert(option >= 0 && option < _mi_option_last);
|
mi_assert(option >= 0 && option < _mi_option_last);
|
||||||
mi_option_desc_t* desc = &options[option];
|
mi_option_desc_t* desc = &options[option];
|
||||||
if (desc->init == UNINIT) {
|
if (mi_unlikely(desc->init == UNINIT)) {
|
||||||
mi_option_init(desc);
|
mi_option_init(desc);
|
||||||
if (option != mi_option_verbose) {
|
if (option != mi_option_verbose) {
|
||||||
_mi_verbose_message("option '%s': %ld\n", desc->name, desc->value);
|
_mi_verbose_message("option '%s': %ld\n", desc->name, desc->value);
|
||||||
|
|
Loading…
Add table
Reference in a new issue