8f70cc4affa0078b12cff80de61981f7a923e730
[libfirm] / ir / adt / hashptr.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/adt/hashptr.h
4  * Purpose:     Hash function for pointers
5  * Author:      Michael Beck, Sebastian Hack
6  * Modified by:
7  * Created:     2004
8  * CVS-ID:      $Id$
9  * Copyright:   (C) 2004 University of Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12 #ifndef __HASHPTR_H__
13 #define __HASHPTR_H__
14
15 /**
16  * hash a pointer value: Pointer addresses are mostly aligned to 4
17  * or 8 bytes. So we remove the lowest 3 bits
18  */
19 #define HASHPTR(ptr)    (((char *)ptr - (char *)0) >> 3)
20
21 #endif /* __HASHPTR_H__ */