atomic: use type parameters
update `closure_exchange_malloc`