No description provided.
Explicitly initialize prevector _union #14028
pull Empact wants to merge 1 commits into bitcoin:master from Empact:prevector-explicit-initialization changing 1 files +5 −5-
Empact commented at 9:24 AM on August 23, 2018: member
- fanquake added the label Refactoring on Aug 23, 2018
- Empact force-pushed on Aug 23, 2018
- Empact force-pushed on Aug 23, 2018
-
in src/prevector.h:175 in bfa1d038f1 outdated
174 | + indirect.indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * _size)); 175 | + assert(indirect.indirect); 176 | + indirect.capacity = _size; 177 | + _size += N + 1; 178 | + return indirect; 179 | + }
Empact commented at 9:42 AM on August 23, 2018:DrahtBot commented at 11:29 AM on August 23, 2018: member<!--e57a25ab6845829454e8d69fc972939a-->No more conflicts as of last run.
in src/prevector.h:267 in bfa1d038f1 outdated
263 | @@ -248,32 +264,24 @@ class prevector { 264 | 265 | prevector() : _size(0), _union{{}} {} 266 | 267 | - explicit prevector(size_type n) : _size(0) { 268 | - resize(n); 269 | + explicit prevector(size_type n) : _size(n), _union{init_union()} {
sipa commented at 4:15 PM on August 23, 2018:This is wrong. The
_sizefield does not directly encode the size (see the comments above the class).
Empact commented at 4:50 PM on August 23, 2018:init_unionadds theN + 1when appropriate.
sipa commented at 4:55 PM on August 23, 2018:Yuck.
Empact commented at 5:15 PM on August 23, 2018:Fair enough, moved it out of the initializer.
Empact force-pushed on Aug 23, 2018Empact force-pushed on Aug 23, 2018Empact force-pushed on Aug 23, 2018Empact force-pushed on Aug 23, 2018practicalswift commented at 5:48 PM on August 23, 2018: contributorConcept ACK
This fixes the compiler warning described in #13902
Empact force-pushed on Aug 24, 2018Empact force-pushed on Aug 24, 2018Empact commented at 8:53 AM on August 24, 2018: memberPared the PR down to just explicitly initializing the _union
practicalswift commented at 9:14 AM on August 24, 2018: contributorThe updated version still fixes the compiler warning.
ACK f955a50384ad53e6d1e89f373905ea8dabc46e93
DrahtBot added the label Needs rebase on Aug 27, 2018Explicitly initialize prevector _union 1d9aa008d6Empact force-pushed on Aug 27, 2018practicalswift commented at 4:57 PM on August 27, 2018: contributorutACK 1d9aa008d6e043c29c3c5b030a6d04278aea233b
ken2812221 commented at 5:00 PM on August 27, 2018: contributorutACK 1d9aa008d6e043c29c3c5b030a6d04278aea233b
DrahtBot removed the label Needs rebase on Aug 27, 2018laanwj merged this on Aug 29, 2018laanwj closed this on Aug 29, 2018laanwj referenced this in commit b0eb8f7ed4 on Aug 29, 2018Empact deleted the branch on Oct 9, 2018MarcoFalke referenced this in commit 3632143ebb on May 6, 2019sidhujag referenced this in commit e97c1bc114 on May 7, 2019Fuzzbawls referenced this in commit 8dfc4806f7 on May 19, 2020PastaPastaPasta referenced this in commit 8dc8d9c32e on Jun 27, 2021PastaPastaPasta referenced this in commit 3325df2cc1 on Jun 27, 2021PastaPastaPasta referenced this in commit afe9198916 on Jun 28, 2021PastaPastaPasta referenced this in commit cdbf7957d2 on Jun 28, 2021PastaPastaPasta referenced this in commit b480328fd0 on Jun 29, 2021PastaPastaPasta referenced this in commit 612b7e8fab on Jun 29, 2021PastaPastaPasta referenced this in commit 431ef8f783 on Jun 29, 2021PastaPastaPasta referenced this in commit aca3eb1b40 on Jun 29, 2021PastaPastaPasta referenced this in commit c62f8f6ef0 on Jun 29, 2021PastaPastaPasta referenced this in commit 493e0e8769 on Jun 29, 2021Munkybooty referenced this in commit 1cbd42663e on Jun 30, 2021PastaPastaPasta referenced this in commit 2d91eb7b77 on Jul 1, 2021PastaPastaPasta referenced this in commit 90f2117558 on Jul 1, 2021PastaPastaPasta referenced this in commit 7b1d8c5e53 on Jul 1, 2021PastaPastaPasta referenced this in commit bb27dde3cc on Jul 8, 2021PastaPastaPasta referenced this in commit 698ca44c98 on Jul 10, 2021MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me