This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for base_pool_allocator (PR other/81667)
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Aug 2017 14:45:46 +0200
- Subject: PATCH for base_pool_allocator (PR other/81667)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=polacek at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 846A881240
This PR points out that m_elt_size was left uninitialized in the member
initializer list for base_pool_allocator. I think it makes sense to initialize
it like this.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2017-08-02 Marek Polacek <polacek@redhat.com>
PR other/81667
* alloc-pool.h (base_pool_allocator): Initialize m_elt_size.
diff --git gcc/alloc-pool.h gcc/alloc-pool.h
index a5236db3dae..1d04e5d2cfe 100644
--- gcc/alloc-pool.h
+++ gcc/alloc-pool.h
@@ -240,8 +240,9 @@ base_pool_allocator <TBlockAllocator>::base_pool_allocator (
const char *name, size_t size MEM_STAT_DECL):
m_name (name), m_id (0), m_elts_per_block (0), m_returned_free_list (NULL),
m_virgin_free_list (NULL), m_virgin_elts_remaining (0), m_elts_allocated (0),
- m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL), m_size (size),
- m_initialized (false), m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {}
+ m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL), m_elt_size (0),
+ m_size (size), m_initialized (false),
+ m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {}
/* Initialize a pool allocator. */
Marek