diff options
author | Martin Liska <mliska@suse.cz> | 2015-06-01 14:34:31 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-06-01 12:34:31 +0000 |
commit | cb8abb1cf9f96365d7fa1f4583ab3cb845876f17 (patch) | |
tree | 6ab57ff78b223b14ea0991bdf21f1047264c68a4 /gcc/lra-int.h | |
parent | 64afff5b0205e524fa696a6a74d5759f0803f8c9 (diff) | |
download | gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.zip gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.tar.gz gcc-cb8abb1cf9f96365d7fa1f4583ab3cb845876f17.tar.bz2 |
Change use to type-based pool allocator in lra-lives.c.
* lra-lives.c (free_live_range): Use new type-based pool allocator.
(free_live_range_list) Likewise.
(create_live_range) Likewise.
(copy_live_range) Likewise.
(lra_merge_live_ranges) Likewise.
(remove_some_program_points_and_update_live_ranges) Likewise.
(lra_live_ranges_init) Likewise.
(lra_live_ranges_finish) Likewise.
From-SVN: r223944
Diffstat (limited to 'gcc/lra-int.h')
-rw-r--r-- | gcc/lra-int.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/lra-int.h b/gcc/lra-int.h index 12923ee..42e4a54 100644 --- a/gcc/lra-int.h +++ b/gcc/lra-int.h @@ -54,6 +54,21 @@ struct lra_live_range lra_live_range_t next; /* Pointer to structures with the same start. */ lra_live_range_t start_next; + + /* 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 ((lra_live_range *) ptr); + } + + /* Memory allocation pool. */ + static pool_allocator<lra_live_range> pool; }; typedef struct lra_copy *lra_copy_t; |