if key is ptr, use the pointer value to generate hash code