aboutsummaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-05-22 07:22:50 +0100
committerRichard Biener <rguenther@suse.de>2020-06-05 09:16:41 +0200
commit6ea6c4978111d146db8d33c80d9da93d7bd2bc8d (patch)
treea548cf85aba746bcf124a908512a8ff704e4fe00 /gcc/alloc-pool.h
parent80d6f89e78fc3b772701988cc73aa8e8006283be (diff)
downloadgcc-6ea6c4978111d146db8d33c80d9da93d7bd2bc8d.zip
gcc-6ea6c4978111d146db8d33c80d9da93d7bd2bc8d.tar.gz
gcc-6ea6c4978111d146db8d33c80d9da93d7bd2bc8d.tar.bz2
Add new/delete to struct occurence
This adds an example how to use new/delete operators to pool allocated objects. 2020-06-04 Jonathan Wakely <jwakely@redhat.com> * alloc-pool.h (object_allocator::remove_raw): New. * tree-ssa-math-opts.c (struct occurrence): Use NSMDI. (occurrence::occurrence): Add. (occurrence::~occurrence): Likewise. (occurrence::new): Likewise. (occurrence::delete): Likewise. (occ_new): Remove. (insert_bb): Use new occurence (...) instead of occ_new. (register_division_in): Likewise. (free_bb): Use delete occ instead of manually removing from the pool.
Diffstat (limited to 'gcc/alloc-pool.h')
-rw-r--r--gcc/alloc-pool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h
index fd7194b..4e78dcf 100644
--- a/gcc/alloc-pool.h
+++ b/gcc/alloc-pool.h
@@ -524,6 +524,12 @@ public:
m_allocator.remove (object);
}
+ inline void
+ remove_raw (void *object)
+ {
+ m_allocator.remove (object);
+ }
+
inline size_t
num_elts_current ()
{