MOD:avoid using malloc when creating tree node, for it won't work on non-main core.