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

Issue 400463002: Class for allocating a chunk of memory for RenderPass (Closed)

Created:
6 years, 5 months ago by weiliangc
Modified:
6 years, 3 months ago
Reviewers:
danakj, jamesr, piman
CC:
chromium-reviews, cc-bugs_chromium.org, Ian Vollick, enne (OOO), piman
Base URL:
https://chromium.googlesource.com/chromium/src.git@mojojojo
Project:
chromium
Visibility:
Public.

Description

Class for allocating a chunk of memory for RenderPass For DrawQuads and SharedQuadState, RenderPass used allocate them one by one whenever needed. This new class helps RenderPass manages allocation and iteration of those two types. This container allocates a chunk of memory at one time and hands out raw pointers. It also provides iterator and reverse iterators for going through its contents. Unittest for ListContainer makes sure the raw pointers it hands out are valid and iterator has same behavior as vector iterators. Follows 398533002, and 404563005. BUG=344962 Committed: https://crrev.com/6ae8c50c839a8c0d8fb399578256c754ed3ce39a Cr-Commit-Position: refs/heads/master@{#296100} Committed: https://crrev.com/d1f5016cb601daa67da3ca36eff3c8af1f35fa60 Cr-Commit-Position: refs/heads/master@{#296176}

Patch Set 1 #

Patch Set 2 : fix compile error #

Patch Set 3 : add erase function #

Patch Set 4 : instead of vector of vector use vector of custom struct #

Patch Set 5 : rebase #

Patch Set 6 : index instead of iterators and store variables to make it faster (mixed with rebase sorry) #

Total comments: 4

Patch Set 7 : add to gn #

Total comments: 4

Patch Set 8 : move from header to source file #

Total comments: 72

Patch Set 9 : scoped ptr vector and also fix bug with reserve #

Patch Set 10 : rebase #

Patch Set 11 : unittest for destructor call and move everything inside and everything #

Patch Set 12 : rm reserve #

Patch Set 13 : next_list_allocation_size_ no more #

Patch Set 14 : fix crash when insert after clear bug and add new unittest for that #

Patch Set 15 : fix the fix #

Total comments: 20

Patch Set 16 : rebase #

Patch Set 17 : address review comments #

Total comments: 69

Patch Set 18 : rebase #

Total comments: 4

Patch Set 19 : simple review comments addressed #

Patch Set 20 : add comment for decrease capacity in erase #

Patch Set 21 : template AllocateAndConstruct function #

Total comments: 12

Patch Set 22 : address review comments #

Total comments: 1

Patch Set 23 : rebase #

Patch Set 24 : use name One and Two #

Patch Set 25 : fix try bot build error because const iterator comparison is a pain #

Patch Set 26 : attemp to fix trybot failures #

Patch Set 27 : test with trybot #

Patch Set 28 : try instan nested class when compile with msvc #

Patch Set 29 : Position is not a class but a struct #

Patch Set 30 : try add more instan in unittest for win component build #

Patch Set 31 : aha cc export #

Total comments: 2

Patch Set 32 : fix linux asan #

Patch Set 33 : use scoped_ptr<char[]> #

Total comments: 2

Patch Set 34 : use reset instead of assignment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1247 lines, -0 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +3 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
A cc/quads/list_container.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +179 lines, -0 lines 0 comments Download
A cc/quads/list_container.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +592 lines, -0 lines 0 comments Download
A cc/quads/list_container_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 30 1 chunk +470 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (4 generated)
weiliangc
Used in CL 448303002
6 years, 4 months ago (2014-08-20 23:30:12 UTC) #1
jamesr
https://codereview.chromium.org/400463002/diff/160001/cc/cc.gyp File cc/cc.gyp (right): https://codereview.chromium.org/400463002/diff/160001/cc/cc.gyp#newcode321 cc/cc.gyp:321: 'quads/list_container.cc', update cc/BUILD.gn too https://codereview.chromium.org/400463002/diff/160001/cc/cc_tests.gyp File cc/cc_tests.gyp (right): https://codereview.chromium.org/400463002/diff/160001/cc/cc_tests.gyp#newcode74 ...
6 years, 4 months ago (2014-08-20 23:32:49 UTC) #2
weiliangc
https://codereview.chromium.org/400463002/diff/160001/cc/cc.gyp File cc/cc.gyp (right): https://codereview.chromium.org/400463002/diff/160001/cc/cc.gyp#newcode321 cc/cc.gyp:321: 'quads/list_container.cc', On 2014/08/20 23:32:49, jamesr wrote: > update cc/BUILD.gn ...
6 years, 4 months ago (2014-08-20 23:38:24 UTC) #3
jamesr
Thanks. build system stuff lgtm but I didn't review the C++
6 years, 4 months ago (2014-08-20 23:40:36 UTC) #4
danakj
https://codereview.chromium.org/400463002/diff/180001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/180001/cc/quads/list_container.cc#newcode32 cc/quads/list_container.cc:32: last_list_(NULL) { this doesn't init list_count_? https://codereview.chromium.org/400463002/diff/180001/cc/quads/list_container.h File cc/quads/list_container.h ...
6 years, 4 months ago (2014-08-21 21:41:23 UTC) #5
weiliangc
Change: - rename classes, e.g. ListContainerAccessor<T> -> ListContainer<T> - forward declare class allocates raw memory ...
6 years, 4 months ago (2014-08-25 19:11:17 UTC) #6
danakj
https://codereview.chromium.org/400463002/diff/200001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/200001/cc/quads/list_container.cc#newcode36 cc/quads/list_container.cc:36: : current_list_size_(kDefaultNumElementTypesToReserve), next_list_allocation_size? https://codereview.chromium.org/400463002/diff/200001/cc/quads/list_container.cc#newcode55 cc/quads/list_container.cc:55: (*i)->~InnerList(); what actually deletes ...
6 years, 3 months ago (2014-08-26 15:55:31 UTC) #7
weiliangc
PTAL. I added more guards for reserve() but hasn't removed it. My assumption for reserve() ...
6 years, 3 months ago (2014-09-03 23:58:03 UTC) #8
danakj
On Wed, Sep 3, 2014 at 7:58 PM, <weiliangc@chromium.org> wrote: > Reviewers: danakj, jamesr, > ...
6 years, 3 months ago (2014-09-04 00:04:22 UTC) #9
weiliangc
Removed reserve and next_list_allocation_size. :)
6 years, 3 months ago (2014-09-04 20:01:11 UTC) #10
danakj
https://codereview.chromium.org/400463002/diff/340001/cc/quads/list_container.h File cc/quads/list_container.h (right): https://codereview.chromium.org/400463002/diff/340001/cc/quads/list_container.h#newcode16 cc/quads/list_container.h:16: // This class is used by RenderPass. It is ...
6 years, 3 months ago (2014-09-09 17:29:13 UTC) #11
weiliangc
Address review comments :D https://codereview.chromium.org/400463002/diff/340001/cc/quads/list_container.h File cc/quads/list_container.h (right): https://codereview.chromium.org/400463002/diff/340001/cc/quads/list_container.h#newcode16 cc/quads/list_container.h:16: // This class is used ...
6 years, 3 months ago (2014-09-12 22:03:55 UTC) #12
danakj
https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc#newcode20 cc/quads/list_container.cc:20: // List Container Char Allocator nit: no spaces https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc#newcode54 ...
6 years, 3 months ago (2014-09-15 21:45:32 UTC) #13
weiliangc
Address review comments with a large list of Done. :) https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc#newcode20 ...
6 years, 3 months ago (2014-09-16 18:57:37 UTC) #14
weiliangc
https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.cc#newcode79 cc/quads/list_container.cc:79: --capacity; On 2014/09/15 21:45:31, danakj wrote: > you actually ...
6 years, 3 months ago (2014-09-16 19:19:53 UTC) #15
weiliangc
https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container_unittest.cc File cc/quads/list_container_unittest.cc (right): https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container_unittest.cc#newcode48 cc/quads/list_container_unittest.cc:48: ListContainer<DrawQuad> list(sizeof(kLargestDrawQuad)); On 2014/09/15 21:45:32, danakj wrote: > with ...
6 years, 3 months ago (2014-09-16 19:26:47 UTC) #16
weiliangc
Addressed all reviews comments. https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.h File cc/quads/list_container.h (right): https://codereview.chromium.org/400463002/diff/380001/cc/quads/list_container.h#newcode146 cc/quads/list_container.h:146: BaseElementType* Allocate(); On 2014/09/15 21:45:32, ...
6 years, 3 months ago (2014-09-17 00:29:47 UTC) #17
danakj
LGTM with some test comments https://codereview.chromium.org/400463002/diff/400001/cc/quads/list_container_unittest.cc File cc/quads/list_container_unittest.cc (right): https://codereview.chromium.org/400463002/diff/400001/cc/quads/list_container_unittest.cc#newcode299 cc/quads/list_container_unittest.cc:299: } can you EXPECT_EQ(num_iters_in_vector, ...
6 years, 3 months ago (2014-09-19 19:43:38 UTC) #18
weiliangc
address all review comments :) https://codereview.chromium.org/400463002/diff/400001/cc/quads/list_container_unittest.cc File cc/quads/list_container_unittest.cc (right): https://codereview.chromium.org/400463002/diff/400001/cc/quads/list_container_unittest.cc#newcode299 cc/quads/list_container_unittest.cc:299: } On 2014/09/19 19:43:37, ...
6 years, 3 months ago (2014-09-19 21:48:42 UTC) #19
danakj
LGTM https://codereview.chromium.org/400463002/diff/480001/cc/quads/list_container_unittest.cc File cc/quads/list_container_unittest.cc (right): https://codereview.chromium.org/400463002/diff/480001/cc/quads/list_container_unittest.cc#newcode44 cc/quads/list_container_unittest.cc:44: class SimpleDrawQuadConstructMagicNumberFortyTwo : public SimpleDrawQuad { This is ...
6 years, 3 months ago (2014-09-19 22:08:28 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/400463002/660001
6 years, 3 months ago (2014-09-22 22:25:53 UTC) #22
commit-bot: I haz the power
Committed patchset #31 (id:660001) as 3c1269bc10a759d9f28aa3079499853a8b19cefe
6 years, 3 months ago (2014-09-22 23:51:34 UTC) #23
commit-bot: I haz the power
Patchset 31 (id:??) landed as https://crrev.com/6ae8c50c839a8c0d8fb399578256c754ed3ce39a Cr-Commit-Position: refs/heads/master@{#296100}
6 years, 3 months ago (2014-09-22 23:52:12 UTC) #24
weiliangc
A revert of this CL (patchset #31 id:660001) has been created in https://codereview.chromium.org/595733002/ by weiliangc@chromium.org. ...
6 years, 3 months ago (2014-09-23 01:18:18 UTC) #25
weiliangc
Linux ASan bot fail is because of mismatch of new[] and delete. In InnerList, scoped_ptr<char> ...
6 years, 3 months ago (2014-09-23 02:05:35 UTC) #26
piman
https://codereview.chromium.org/400463002/diff/660001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/660001/cc/quads/list_container.cc#newcode32 cc/quads/list_container.cc:32: scoped_ptr<char> data; You can use scoped_ptr<char[]> instead.
6 years, 3 months ago (2014-09-23 02:32:14 UTC) #28
weiliangc
https://codereview.chromium.org/400463002/diff/660001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/660001/cc/quads/list_container.cc#newcode32 cc/quads/list_container.cc:32: scoped_ptr<char> data; On 2014/09/23 02:32:14, piman (Very slow to ...
6 years, 3 months ago (2014-09-23 02:45:51 UTC) #29
piman
lgtm https://codereview.chromium.org/400463002/diff/700001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/700001/cc/quads/list_container.cc#newcode149 cc/quads/list_container.cc:149: list->data = scoped_ptr<char[]>(new char[list->capacity * list->step]); nit: or ...
6 years, 3 months ago (2014-09-23 02:47:01 UTC) #30
weiliangc
https://codereview.chromium.org/400463002/diff/700001/cc/quads/list_container.cc File cc/quads/list_container.cc (right): https://codereview.chromium.org/400463002/diff/700001/cc/quads/list_container.cc#newcode149 cc/quads/list_container.cc:149: list->data = scoped_ptr<char[]>(new char[list->capacity * list->step]); On 2014/09/23 02:47:01, ...
6 years, 3 months ago (2014-09-23 03:07:38 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/400463002/720001
6 years, 3 months ago (2014-09-23 13:32:31 UTC) #33
commit-bot: I haz the power
Failed to apply the patch.
6 years, 3 months ago (2014-09-23 14:29:05 UTC) #35
commit-bot: I haz the power
Committed patchset #34 (id:720001) as 215126610b98166e27e87d84e65df9bd453805d2
6 years, 3 months ago (2014-09-23 14:29:10 UTC) #36
commit-bot: I haz the power
6 years, 3 months ago (2014-09-23 14:29:50 UTC) #37
Message was sent while issue was closed.
Patchset 34 (id:??) landed as
https://crrev.com/d1f5016cb601daa67da3ca36eff3c8af1f35fa60
Cr-Commit-Position: refs/heads/master@{#296176}

Powered by Google App Engine
This is Rietveld 408576698