Simple hash function for pointers has better performance.