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

Issue 1498133002: Add AlignedVector and use it for vector<MEMORY_BASIC_INFORMATION64> (Closed)

Created:
5 years ago by Mark Mentovai
Modified:
5 years ago
Reviewers:
scottmg
CC:
crashpad-dev_chromium.org, Nico, Reid Kleckner, hans
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

Add AlignedVector and use it for vector<MEMORY_BASIC_INFORMATION64> MEMORY_BASIC_INFORMATION64 specifies an alignment of 16, but the standard allocator used by containers doesn't honor this. Although 16 is the default alignment size used on Windows for x86_64, it's not for 32-bit x86. clang assumed that the alignment of the structure was as declared, and used an SSE load sequence that required this alignment. AlignedAllocator is a replacement for std::allocator that allows the alignment to be specified. AlignedVector is an std::vector<> that uses AlignedAllocator instead of std::allocator. BUG=chromium:564691 R=scottmg@chromium.org Committed: https://chromium.googlesource.com/crashpad/crashpad/+/f55d18ade6877134e87515d9e2fc332dd40dea19

Patch Set 1 #

Total comments: 2

Patch Set 2 : For checkin? #

Total comments: 2

Patch Set 3 : Address review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+365 lines, -18 lines) Patch
A util/stdlib/aligned_allocator.h View 1 2 1 chunk +131 lines, -0 lines 0 comments Download
A util/stdlib/aligned_allocator.cc View 1 chunk +78 lines, -0 lines 0 comments Download
A util/stdlib/aligned_allocator_test.cc View 1 1 chunk +117 lines, -0 lines 0 comments Download
M util/util.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M util/util_test.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M util/win/process_info.h View 1 5 chunks +20 lines, -3 lines 0 comments Download
M util/win/process_info.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M util/win/process_info_test.cc View 12 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 28 (6 generated)
Mark Mentovai
5 years ago (2015-12-04 18:11:15 UTC) #2
scottmg
According to the docs, the alignment declartion only applies to stack and static allocations, so ...
5 years ago (2015-12-04 18:18:21 UTC) #3
Nico
Yeah, I kind of feel that clang needs to become more conservative here. rnk, thoughts?
5 years ago (2015-12-04 18:20:10 UTC) #5
scottmg
(Also, if this is the only one we think we need to do this for, ...
5 years ago (2015-12-04 18:21:51 UTC) #6
Nico
On 2015/12/04 18:21:51, scottmg wrote: > (Also, if this is the only one we think ...
5 years ago (2015-12-04 18:24:20 UTC) #7
Reid Kleckner
On 2015/12/04 18:20:10, Nico wrote: > Yeah, I kind of feel that clang needs to ...
5 years ago (2015-12-04 19:16:20 UTC) #8
Reid Kleckner
On 2015/12/04 19:16:20, Reid Kleckner wrote: > Anyway, I emailed John about it. He's the ...
5 years ago (2015-12-04 19:41:12 UTC) #9
Nico
On 2015/12/04 19:41:12, Reid Kleckner wrote: > On 2015/12/04 19:16:20, Reid Kleckner wrote: > > ...
5 years ago (2015-12-04 19:47:11 UTC) #10
Mark Mentovai
I would think that if the standard supports what MSVC does (substituting alignas() for __declspec(align()) ...
5 years ago (2015-12-04 19:48:11 UTC) #12
scottmg
I think clang is in the wrong, and this seems like kind of a lot ...
5 years ago (2015-12-04 19:58:51 UTC) #13
Mark Mentovai
I won’t check this in until clang definitely says they’re not fixing it because they ...
5 years ago (2015-12-04 20:01:39 UTC) #14
Reid Kleckner
On 2015/12/04 20:01:39, Mark Mentovai wrote: > I won’t check this in until clang definitely ...
5 years ago (2015-12-07 19:34:22 UTC) #15
scottmg
On 2015/12/07 19:34:22, Reid Kleckner wrote: > On 2015/12/04 20:01:39, Mark Mentovai wrote: > > ...
5 years ago (2015-12-07 20:42:23 UTC) #16
Mark Mentovai
I had a chance to look into this a little more. I don’t think that ...
5 years ago (2015-12-07 22:05:38 UTC) #17
hans
On 2015/12/07 20:42:23, scottmg wrote: > On 2015/12/07 19:34:22, Reid Kleckner wrote: > > On ...
5 years ago (2015-12-07 22:36:43 UTC) #18
Mark Mentovai
hans wrote: > On 2015/12/07 20:42:23, scottmg wrote: > > On 2015/12/07 19:34:22, Reid Kleckner ...
5 years ago (2015-12-08 00:48:48 UTC) #19
Nico
hans, rnk, and I just discussed what we want to do in clang-cl and we ...
5 years ago (2015-12-08 18:27:51 UTC) #21
Mark Mentovai
Is there a clang bug that we can point this to, so that our future ...
5 years ago (2015-12-08 19:14:18 UTC) #22
Mark Mentovai
Updated with commentary for checkin. Scott, one more look?
5 years ago (2015-12-08 20:13:06 UTC) #24
scottmg
lgtm https://codereview.chromium.org/1498133002/diff/20001/util/stdlib/aligned_allocator.h File util/stdlib/aligned_allocator.h (right): https://codereview.chromium.org/1498133002/diff/20001/util/stdlib/aligned_allocator.h#newcode30 util/stdlib/aligned_allocator.h:30: #define NOEXCEPT _NOEXCEPT Since this is in a ...
5 years ago (2015-12-08 20:19:55 UTC) #25
Mark Mentovai
https://codereview.chromium.org/1498133002/diff/20001/util/stdlib/aligned_allocator.h File util/stdlib/aligned_allocator.h (right): https://codereview.chromium.org/1498133002/diff/20001/util/stdlib/aligned_allocator.h#newcode30 util/stdlib/aligned_allocator.h:30: #define NOEXCEPT _NOEXCEPT scottmg wrote: > Since this is ...
5 years ago (2015-12-08 20:38:05 UTC) #26
Mark Mentovai
5 years ago (2015-12-08 20:38:24 UTC) #28
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
f55d18ade6877134e87515d9e2fc332dd40dea19 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698