Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1739)

Issue 6295043: Fixes a bug caused by a reallocation on vector. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by hsumita1
Modified:
11 years, 11 months ago
Reviewers:
shawn.p.huang, Peng Huang, penghuang
Base URL:
git@github.com:pyzy/pyzy.git@master
Visibility:
Public.

Description

Fixes a bug caused by a reallocation on vector. BUG=Database::query crashes on some situation TEST=Manual

Patch Set 1 #

Patch Set 2 : Add comment #

Patch Set 3 : Reverts some files which are uploaded by my mistake. #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -1 line) Patch
M src/PyZyDatabase.cc View 1 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 3
hsumita1
11 years, 11 months ago (2012-06-05 07:27:22 UTC) #1
Peng
lgtm. But don't understand why origin code has problem. Please explain it. Thanks.
11 years, 11 months ago (2012-06-05 14:15:28 UTC) #2
hsumita1
11 years, 11 months ago (2012-06-06 04:58:58 UTC) #3
On 2012/06/05 14:15:28, Peng wrote:
> lgtm. But don't understand why origin code has problem. Please explain it.
> Thanks.

I added a comment.

Please see also
http://cplusplus.com/reference/stl/vector/push_back/
> This effectively increases the vector size by one, which causes a reallocation
of the internal allocated
> storage if the vector size was equal to the vector capacity before the call.
Reallocations invalidate all
> previously obtained iterators, references and pointers.

Submitting...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b