aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cselib.h')
-rw-r--r--gcc/cselib.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/gcc/cselib.h b/gcc/cselib.h
index 082bf54..cdd06ad 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -21,7 +21,8 @@ along with GCC; see the file COPYING3. If not see
#define GCC_CSELIB_H
/* Describe a value. */
-struct cselib_val {
+struct cselib_val
+{
/* The hash value. */
unsigned int hash;
@@ -40,6 +41,21 @@ struct cselib_val {
struct elt_list *addr_list;
struct cselib_val *next_containing_mem;
+
+ /* Pool allocation new operator. */
+ inline void *operator new (size_t)
+ {
+ return pool.allocate ();
+ }
+
+ /* Delete operator utilizing pool allocation. */
+ inline void operator delete (void *ptr)
+ {
+ pool.remove ((cselib_val *) ptr);
+ }
+
+ /* Memory allocation pool. */
+ static pool_allocator<cselib_val> pool;
};
/* A list of rtl expressions that hold the same value. */
@@ -50,6 +66,21 @@ struct elt_loc_list {
rtx loc;
/* The insn that made the equivalence. */
rtx_insn *setting_insn;
+
+ /* Pool allocation new operator. */
+ inline void *operator new (size_t)
+ {
+ return pool.allocate ();
+ }
+
+ /* Delete operator utilizing pool allocation. */
+ inline void operator delete (void *ptr)
+ {
+ pool.remove ((elt_loc_list *) ptr);
+ }
+
+ /* Memory allocation pool. */
+ static pool_allocator<elt_loc_list> pool;
};
/* Describe a single set that is part of an insn. */