xf86drmHash.h 922 B

123456789101112131415161718192021222324252627
  1. /*
  2. * SPDX-FileCopyrightText: 1999 Precision Insight, Inc., Cedar Park, Texas.
  3. * SPDX-License-Identifier: MIT
  4. * SPDX-FileContributor: Rickard E. (Rik) Faith <faith@valinux.com>
  5. */
  6. #define HASH_SIZE 512 /* Good for about 100 entries */
  7. /* If you change this value, you probably
  8. have to change the HashHash hashing
  9. function! */
  10. typedef struct HashBucket {
  11. unsigned long key;
  12. void *value;
  13. struct HashBucket *next;
  14. } HashBucket, *HashBucketPtr;
  15. typedef struct HashTable {
  16. unsigned long magic;
  17. unsigned long entries;
  18. unsigned long hits; /* At top of linked list */
  19. unsigned long partials; /* Not at top of linked list */
  20. unsigned long misses; /* Not in table */
  21. HashBucketPtr buckets[HASH_SIZE];
  22. int p0;
  23. HashBucketPtr p1;
  24. } HashTable, *HashTablePtr;