free-lock hash by c++