call to_hash before replacing hash
implement Hash#initialize in C