diff options
author | Martin Liska <mliska@suse.cz> | 2015-06-01 14:35:20 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-06-01 12:35:20 +0000 |
commit | 2f77a6072cccc1520dd609ac48cafda69a76832b (patch) | |
tree | 008a159a89c869dd4720803459e82654d1921879 /gcc/lra-int.h | |
parent | cb8abb1cf9f96365d7fa1f4583ab3cb845876f17 (diff) |
Change use to type-based pool allocator in lra.c.
* lra.c (init_insn_regs): Use new type-based pool allocator.
(new_insn_reg) Likewise.
(free_insn_reg) Likewise.
(free_insn_regs) Likewise.
(finish_insn_regs) Likewise.
(init_insn_recog_data) Likewise.
(init_reg_info) Likewise.
(finish_reg_info) Likewise.
(lra_free_copies) Likewise.
(lra_create_copy) Likewise.
(invalidate_insn_data_regno_info) Likewise.
From-SVN: r223945
Diffstat (limited to 'gcc/lra-int.h')
-rw-r--r-- | gcc/lra-int.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/lra-int.h b/gcc/lra-int.h index 42e4a5445d5..25bd3cefd81 100644 --- a/gcc/lra-int.h +++ b/gcc/lra-int.h @@ -84,6 +84,22 @@ struct lra_copy int regno1, regno2; /* Next copy with correspondingly REGNO1 and REGNO2. */ lra_copy_t regno1_next, regno2_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_copy *) ptr); + } + + /* Memory allocation pool. */ + static pool_allocator<lra_copy> pool; + }; /* Common info about a register (pseudo or hard register). */ @@ -191,6 +207,21 @@ struct lra_insn_reg int regno; /* Next reg info of the same insn. */ struct lra_insn_reg *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_insn_reg *) ptr); + } + + /* Memory allocation pool. */ + static pool_allocator<lra_insn_reg> pool; }; /* Static part (common info for insns with the same ICODE) of LRA |