Rerouting reallocation to main thread