This might be controlled by a global variable, like mp_set/get_memory_functions(), with default to use alloca(), if available.