Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Issue 519045: Refactor lazy_instance to avoid a strict aliasing problem with gcc 4.4. (Closed)

Created:
10 years, 11 months ago by Craig
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Refactor lazy_instance to avoid a strict aliasing problem with gcc 4.4. The key change here is to use the Type* returned from placement new rather than casting the buffer to a Type*. This change also rolls the lazy instance helper into lazy instance as the lazy instance helper would have to have been templatized to deal with the aforementioned change and so would have to have moved into the header file anyway. BUG=28749

Patch Set 1 #

Patch Set 2 : fix whitespace #

Patch Set 3 : use condingstyle ordering of data members #

Patch Set 4 : Remove extra MemoryBarrier #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -92 lines) Patch
M base/base.gypi View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M base/lazy_instance.h View 1 2 3 3 chunks +56 lines, -40 lines 0 comments Download
D base/lazy_instance.cc View 1 chunk +0 lines, -51 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Craig
Dean I was hoping you could review this for me or recommend someone for the ...
10 years, 11 months ago (2010-01-10 14:59:42 UTC) #1
Craig
On 2010/01/10 14:59:42, Craig wrote: > Dean I was hoping you could review this for ...
10 years, 11 months ago (2010-01-10 16:01:35 UTC) #2
Dean McNamee
When this was written, Darin specifically wanted the helper non-template superclass to reduce the footprint ...
10 years, 11 months ago (2010-01-10 19:05:03 UTC) #3
darin (slow to review)
Yeah, it's usually good practice to factor template classes like this if they are meaty ...
10 years, 11 months ago (2010-01-12 08:19:04 UTC) #4
Craig
On 2010/01/12 08:19:04, darin wrote: > Yeah, it's usually good practice to factor template classes ...
10 years, 11 months ago (2010-01-12 12:06:32 UTC) #5
darin (slow to review)
On Tue, Jan 12, 2010 at 4:06 AM, <craig.schlenter@chromium.org> wrote: > On 2010/01/12 08:19:04, darin ...
10 years, 11 months ago (2010-01-12 18:09:09 UTC) #6
Craig
On 2010/01/12 18:09:09, darin wrote: [snip] > Something like that seems reasonable to me, but ...
10 years, 11 months ago (2010-01-12 18:24:15 UTC) #7
Craig
I've put a rough version of the "NeedsInstance" version of the patch here btw.: http://codereview.chromium.org/548011 ...
10 years, 11 months ago (2010-01-12 18:38:59 UTC) #8
darin (slow to review)
On Tue, Jan 12, 2010 at 10:38 AM, <craig.schlenter@chromium.org> wrote: > I've put a rough ...
10 years, 11 months ago (2010-01-12 18:52:35 UTC) #9
jamesr
Naive suggestion: Just heap allocate the space for Type. Our allocator should be fast enough ...
10 years, 11 months ago (2010-01-12 19:13:07 UTC) #10
Craig
On 2010/01/12 19:13:07, jamesr wrote: > Naive suggestion: > > Just heap allocate the space ...
10 years, 11 months ago (2010-01-12 19:20:09 UTC) #11
jamesr
On 2010/01/12 19:20:09, Craig wrote: > On 2010/01/12 19:13:07, jamesr wrote: > > Naive suggestion: ...
10 years, 11 months ago (2010-01-12 19:21:45 UTC) #12
jamesr
How does this code assure that buf_ is the proper alignment to have contain a ...
10 years, 11 months ago (2010-01-13 06:39:45 UTC) #13
Craig
On 2010/01/13 06:39:45, jamesr wrote: > How does this code assure that buf_ is the ...
10 years, 11 months ago (2010-01-13 07:11:28 UTC) #14
Craig
10 years, 11 months ago (2010-01-13 21:01:18 UTC) #15
I'm going to close this btw. since it has been replaced by
http://codereview.chromium.org/548011

Powered by Google App Engine
This is Rietveld 408576698