Subversion Repositories Kolibri OS

Rev

Rev 5191 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5191 Rev 6324
Line 1... Line 1...
1
/* A splay-tree datatype.  
1
/* A splay-tree datatype.  
2
   Copyright 1998, 1999, 2000, 2002, 2005, 2007, 2009, 2010
-
 
3
   Free Software Foundation, Inc.
2
   Copyright (C) 1998-2015 Free Software Foundation, Inc.
4
   Contributed by Mark Mitchell (mark@markmitchell.com).
3
   Contributed by Mark Mitchell (mark@markmitchell.com).
Line 5... Line 4...
5
 
4
 
Line 6... Line 5...
6
   This file is part of GCC.
5
   This file is part of GCC.
Line 42... Line 41...
42
#endif
41
#endif
43
#ifdef HAVE_INTTYPES_H
42
#ifdef HAVE_INTTYPES_H
44
#include 
43
#include 
45
#endif
44
#endif
Line 46... Line -...
46
 
-
 
47
#ifndef GTY
-
 
48
#define GTY(X)
-
 
49
#endif
-
 
50
 
45
 
51
/* Use typedefs for the key and data types to facilitate changing
46
/* Use typedefs for the key and data types to facilitate changing
52
   these types, if necessary.  These types should be sufficiently wide
47
   these types, if necessary.  These types should be sufficiently wide
53
   that any pointer or scalar can be cast to these types, and then
48
   that any pointer or scalar can be cast to these types, and then
54
   cast back, without loss of precision.  */
49
   cast back, without loss of precision.  */
Line 84... Line 79...
84
   memory to be freed; the latter is a data pointer the splay tree
79
   memory to be freed; the latter is a data pointer the splay tree
85
   functions pass through to the freer.  */
80
   functions pass through to the freer.  */
86
typedef void (*splay_tree_deallocate_fn) (void *, void *);
81
typedef void (*splay_tree_deallocate_fn) (void *, void *);
Line 87... Line 82...
87
 
82
 
88
/* The nodes in the splay tree.  */
83
/* The nodes in the splay tree.  */
89
struct GTY(()) splay_tree_node_s {
84
struct splay_tree_node_s {
90
  /* The key.  */
85
  /* The key.  */
Line 91... Line 86...
91
  splay_tree_key GTY ((use_param1)) key;
86
  splay_tree_key key;
92
 
87
 
Line 93... Line 88...
93
  /* The value.  */
88
  /* The value.  */
94
  splay_tree_value GTY ((use_param2)) value;
89
  splay_tree_value value;
95
 
90
 
96
  /* The left and right children, respectively.  */
91
  /* The left and right children, respectively.  */
Line 97... Line 92...
97
  splay_tree_node GTY ((use_params)) left;
92
  splay_tree_node left;
98
  splay_tree_node GTY ((use_params)) right;
93
  splay_tree_node right;
99
};
94
};
100
 
95
 
Line 101... Line 96...
101
/* The splay tree itself.  */
96
/* The splay tree itself.  */
102
struct GTY(()) splay_tree_s {
97
struct splay_tree_s {
Line 103... Line 98...
103
  /* The root of the tree.  */
98
  /* The root of the tree.  */
Line 117... Line 112...
117
 
112
 
118
  /* Free function for nodes and trees.  Takes allocate_data as a parameter.  */
113
  /* Free function for nodes and trees.  Takes allocate_data as a parameter.  */
Line 119... Line 114...
119
  splay_tree_deallocate_fn deallocate;
114
  splay_tree_deallocate_fn deallocate;
120
 
115
 
121
  /* Parameter for allocate/free functions.  */
116
  /* Parameter for allocate/free functions.  */
Line 122... Line 117...
122
  void * GTY((skip)) allocate_data;
117
  void *allocate_data;
Line 123... Line 118...
123
};
118
};