[core] replaces the free_memory library with the official one.