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

Issue 9186057: Add ALIGNAS and ALIGNOF macros to ensure proper alignment of StaticMemorySingletonTraits (Closed)

Created:
8 years, 11 months ago by jbates
Modified:
8 years, 10 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Add ALIGNAS and ALIGNOF macros to ensure proper alignment of StaticMemorySingletonTraits BUG=95006 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=123270

Patch Set 1 #

Patch Set 2 : win compile #

Patch Set 3 : win compile #

Total comments: 10

Patch Set 4 : added aligned_memory.h, siggi feedback #

Patch Set 5 : abandoned new/delete support #

Total comments: 15

Patch Set 6 : siggi, jyasskin feedback #

Total comments: 4

Patch Set 7 : changed to POD, fixed LazyInstance and StackVector #

Patch Set 8 : willchan feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -41 lines) Patch
M base/base.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M base/compiler_specific.h View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M base/lazy_instance.h View 1 2 3 4 5 6 5 chunks +10 lines, -9 lines 0 comments Download
M base/lazy_instance_unittest.cc View 1 2 3 4 5 6 2 chunks +31 lines, -0 lines 0 comments Download
A base/memory/aligned_memory.h View 1 2 3 4 5 6 1 chunk +77 lines, -0 lines 0 comments Download
A base/memory/aligned_memory_unittest.cc View 1 2 3 4 5 6 7 1 chunk +50 lines, -0 lines 0 comments Download
M base/memory/singleton.h View 1 2 3 4 5 6 3 chunks +6 lines, -12 lines 0 comments Download
M base/memory/singleton_unittest.cc View 1 2 3 4 5 6 2 chunks +37 lines, -0 lines 0 comments Download
M base/stack_container.h View 1 2 3 4 5 6 2 chunks +4 lines, -10 lines 0 comments Download
M base/stack_container_unittest.cc View 1 2 3 4 5 6 2 chunks +25 lines, -10 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
jbates
ptal
8 years, 11 months ago (2012-01-13 01:36:18 UTC) #1
Sigurður Ásgeirsson
http://codereview.chromium.org/9186057/diff/7001/base/compiler_specific.h File base/compiler_specific.h (right): http://codereview.chromium.org/9186057/diff/7001/base/compiler_specific.h#newcode104 base/compiler_specific.h:104: #define ALIGNED(byte_alignment) __declspec(align(byte_alignment)) MSVS wants __declspec to precede the ...
8 years, 11 months ago (2012-01-13 14:32:18 UTC) #2
jbates
http://codereview.chromium.org/9186057/diff/7001/base/compiler_specific.h File base/compiler_specific.h (right): http://codereview.chromium.org/9186057/diff/7001/base/compiler_specific.h#newcode104 base/compiler_specific.h:104: #define ALIGNED(byte_alignment) __declspec(align(byte_alignment)) On 2012/01/13 14:32:18, Ruðrugis wrote: > ...
8 years, 11 months ago (2012-01-13 17:29:17 UTC) #3
willchan no longer on Chromium
Redirecting to evan@ since he probably understands these compiler issues better than I.
8 years, 10 months ago (2012-02-15 01:49:23 UTC) #4
Evan Martin
I asked jyasskin about this and he suggested s/ALIGNED/ALIGNAS/ as the latter is the way ...
8 years, 10 months ago (2012-02-15 21:54:38 UTC) #5
jbates
On 2012/02/15 21:54:38, Evan Martin wrote: > I asked jyasskin about this and he suggested ...
8 years, 10 months ago (2012-02-15 22:24:51 UTC) #6
Jeffrey Yasskin (google)
http://codereview.chromium.org/9186057/diff/7001/base/memory/singleton.h File base/memory/singleton.h (right): http://codereview.chromium.org/9186057/diff/7001/base/memory/singleton.h#newcode118 base/memory/singleton.h:118: // We are protected by a memory barrier. Unrelated ...
8 years, 10 months ago (2012-02-15 22:27:19 UTC) #7
jbates
http://codereview.chromium.org/9186057/diff/7001/base/memory/singleton.h File base/memory/singleton.h (right): http://codereview.chromium.org/9186057/diff/7001/base/memory/singleton.h#newcode118 base/memory/singleton.h:118: // We are protected by a memory barrier. On ...
8 years, 10 months ago (2012-02-15 22:51:33 UTC) #8
jbates
ptal http://codereview.chromium.org/9186057/diff/25003/base/memory/singleton.h File base/memory/singleton.h (left): http://codereview.chromium.org/9186057/diff/25003/base/memory/singleton.h#oldcode119 base/memory/singleton.h:119: base::subtle::NoBarrier_Store(&dead_, 1); dead_ is already set to 1 ...
8 years, 10 months ago (2012-02-21 23:39:04 UTC) #9
willchan no longer on Chromium
Jeffrey, I'm going to defer to you here if you don't mind. I'll rubberstamp when ...
8 years, 10 months ago (2012-02-21 23:42:57 UTC) #10
Sigurður Ásgeirsson
lgtm with a nit - though I'm not an owner here. http://codereview.chromium.org/9186057/diff/25003/base/memory/aligned_memory_unittest.cc File base/memory/aligned_memory_unittest.cc (right): ...
8 years, 10 months ago (2012-02-22 15:31:32 UTC) #11
Jeffrey Yasskin (google)
LGTM. My suggestions below are all taste, and since I'm not on Chromium, Will's in ...
8 years, 10 months ago (2012-02-22 18:38:42 UTC) #12
jbates
http://codereview.chromium.org/9186057/diff/25003/base/memory/aligned_memory.h File base/memory/aligned_memory.h (right): http://codereview.chromium.org/9186057/diff/25003/base/memory/aligned_memory.h#newcode42 base/memory/aligned_memory.h:42: void* operator new(size_t size) { \ On 2012/02/22 18:38:42, ...
8 years, 10 months ago (2012-02-22 19:37:15 UTC) #13
jbates
There might be one problem. If AlignedMemory is not POD, we may get static initializers ...
8 years, 10 months ago (2012-02-22 20:13:15 UTC) #14
Sigurður Ásgeirsson
On Wed, Feb 22, 2012 at 15:13, <jbates@chromium.org> wrote: > There might be one problem. ...
8 years, 10 months ago (2012-02-22 20:21:00 UTC) #15
Jeffrey Yasskin (google)
On 2012/02/22 20:13:15, jbates wrote: > There might be one problem. If AlignedMemory is not ...
8 years, 10 months ago (2012-02-22 22:04:47 UTC) #16
jbates
On 2012/02/22 22:04:47, Jeffrey Yasskin (google) wrote: > On 2012/02/22 20:13:15, jbates wrote: > > ...
8 years, 10 months ago (2012-02-22 22:12:22 UTC) #17
jbates
On 2012/02/22 22:12:22, jbates wrote: > On 2012/02/22 22:04:47, Jeffrey Yasskin (google) wrote: > > ...
8 years, 10 months ago (2012-02-22 22:33:16 UTC) #18
Jeffrey Yasskin (google)
On Wed, Feb 22, 2012 at 2:12 PM, <jbates@chromium.org> wrote: > On 2012/02/22 22:04:47, Jeffrey ...
8 years, 10 months ago (2012-02-22 23:10:22 UTC) #19
jbates
ptal - I fixed a couple other instances where char* was casted to template types.
8 years, 10 months ago (2012-02-23 00:41:30 UTC) #20
willchan no longer on Chromium
http://codereview.chromium.org/9186057/diff/24003/base/memory/aligned_memory_unittest.cc File base/memory/aligned_memory_unittest.cc (right): http://codereview.chromium.org/9186057/diff/24003/base/memory/aligned_memory_unittest.cc#newcode23 base/memory/aligned_memory_unittest.cc:23: EXPECT_EQ(ALIGNOF(raw8), 8u); You've got the expectations reversed. It should ...
8 years, 10 months ago (2012-02-23 01:18:41 UTC) #21
jbates
http://codereview.chromium.org/9186057/diff/24003/base/memory/aligned_memory_unittest.cc File base/memory/aligned_memory_unittest.cc (right): http://codereview.chromium.org/9186057/diff/24003/base/memory/aligned_memory_unittest.cc#newcode23 base/memory/aligned_memory_unittest.cc:23: EXPECT_EQ(ALIGNOF(raw8), 8u); On 2012/02/23 01:18:41, willchan wrote: > You've ...
8 years, 10 months ago (2012-02-23 02:23:53 UTC) #22
willchan no longer on Chromium
lgtm
8 years, 10 months ago (2012-02-23 03:32:05 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbates@chromium.org/9186057/32007
8 years, 10 months ago (2012-02-23 17:32:34 UTC) #24
commit-bot: I haz the power
Presubmit check for 9186057-32007 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-23 17:32:41 UTC) #25
willchan no longer on Chromium
8 years, 10 months ago (2012-02-23 17:39:50 UTC) #26
I think you may need to bypass this presubmit.

On Thu, Feb 23, 2012 at 9:32 AM, <commit-bot@chromium.org> wrote:

> Presubmit check for 9186057-32007 failed and returned exit status 1.
>
> Running presubmit commit checks ...
>
> ** Presubmit Messages **
> If this change requires manual test instructions to QA team, add
> TEST=[instructions].
>
> ** Presubmit ERRORS **
> Found Singleton<T> in the following header files.
> Please move them to an appropriate source file so that the template gets
> instantiated in a single compilation unit.
>  base/memory/singleton.h
>
> Presubmit checks took 1.9s to calculate.
>
>
>
>
http://codereview.chromium.**org/9186057/<http://codereview.chromium.org/9186...
>

Powered by Google App Engine
This is Rietveld 408576698