model: make thread_map heap allocated