Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (21 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28dir.info
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/include/hashtab.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* An expandable hash tables datatype. 
    2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
     2   Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
    33   Contributed by Vladimir Makarov (vmakarov@cygnus.com).
    44
     
    3737#endif /* __cplusplus */
    3838
    39 #include <ansidecl.h>
     39#include "ansidecl.h"
     40
     41#ifndef GTY
     42#define GTY(X)
     43#endif
    4044
    4145/* The type for a hash code.  */
     
    6468typedef int (*htab_trav) PARAMS ((void **, void *));
    6569
     70/* Memory-allocation function, with the same functionality as calloc().
     71   Iff it returns NULL, the hash table implementation will pass an error
     72   code back to the user, so if your code doesn't handle errors,
     73   best if you use xcalloc instead.  */
     74typedef PTR (*htab_alloc) PARAMS ((size_t, size_t));
     75
     76/* We also need a free() routine.  */
     77typedef void (*htab_free) PARAMS ((PTR));
     78
    6679/* Hash tables are of the following type.  The structure
    6780   (implementation) of this type is not needed for using the hash
     
    6982   functions mentioned below. */
    7083
    71 struct htab
     84struct htab GTY(())
    7285{
    7386  /* Pointer to hash function.  */
     
    8194
    8295  /* Table itself.  */
    83   PTR *entries;
     96  PTR * GTY ((use_param (""), length ("%h.size"))) entries;
    8497
    8598  /* Current size (in entries) of the hash table */
     
    100113  unsigned int collisions;
    101114
    102   /* This is non-zero if we are allowed to return NULL for function calls
    103      that allocate memory.  */
    104   int return_allocation_failure;
     115  /* Pointers to allocate/free functions.  */
     116  htab_alloc alloc_f;
     117  htab_free free_f;
    105118};
    106119
     
    112125/* The prototypes of the package functions. */
    113126
    114 extern htab_t   htab_create     PARAMS ((size_t, htab_hash,
    115                                          htab_eq, htab_del));
     127extern htab_t   htab_create_alloc       PARAMS ((size_t, htab_hash,
     128                                                 htab_eq, htab_del,
     129                                                 htab_alloc, htab_free));
    116130
    117 /* This function is like htab_create, but may return NULL if memory
    118    allocation fails, and also signals that htab_find_slot_with_hash and
    119    htab_find_slot are allowed to return NULL when inserting.  */
    120 extern htab_t   htab_try_create PARAMS ((size_t, htab_hash,
    121                                          htab_eq, htab_del));
     131/* Backward-compatibility functions.  */
     132extern htab_t htab_create PARAMS ((size_t, htab_hash, htab_eq, htab_del));
     133extern htab_t htab_try_create PARAMS ((size_t, htab_hash, htab_eq, htab_del));
     134
    122135extern void     htab_delete     PARAMS ((htab_t));
    123136extern void     htab_empty      PARAMS ((htab_t));
Note: See TracChangeset for help on using the changeset viewer.