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

Issue 16271010: Use 'new' in all the snapshot reallocation functions instead of realloc. (Closed)

Created:
7 years, 6 months ago by siva
Modified:
7 years, 6 months ago
Reviewers:
Søren Gjesse, srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix for issue 1755. Use 'new' in all the snapshot reallocation functions instead of realloc. This would result in program termination when allocation fails and will ensure that a NULL will not be returned. R=srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=23636

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -25 lines) Patch
M runtime/lib/isolate.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/platform/utils.h View 1 1 chunk +21 lines, -0 lines 0 comments Download
M runtime/vm/benchmark_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/class_table.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/code_observers.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/dart_api_message.cc View 1 1 chunk +10 lines, -7 lines 0 comments Download
M runtime/vm/debuginfo.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/megamorphic_cache_table.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/object.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
siva
7 years, 6 months ago (2013-06-04 01:37:06 UTC) #1
Søren Gjesse
dbc. https://codereview.chromium.org/16271010/diff/1/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/16271010/diff/1/runtime/vm/dart_api_message.cc#newcode809 runtime/vm/dart_api_message.cc:809: if (forward_id_ >= forward_list_length_) { Not related to ...
7 years, 6 months ago (2013-06-04 06:54:47 UTC) #2
srdjan
LGTM https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h File runtime/platform/utils.h (right): https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h#newcode178 runtime/platform/utils.h:178: if ((old_len * sizeof(ElementType)) >= greater only https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h#newcode186 ...
7 years, 6 months ago (2013-06-04 20:15:58 UTC) #3
siva
Committed patchset #2 manually as r23636 (presubmit successful).
7 years, 6 months ago (2013-06-05 16:21:10 UTC) #4
siva
7 years, 6 months ago (2013-06-05 16:21:31 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h
File runtime/platform/utils.h (right):

https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h#newc...
runtime/platform/utils.h:178: if ((old_len * sizeof(ElementType)) >=
On 2013/06/04 20:15:58, srdjan wrote:
> greater only

Done.

https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h#newc...
runtime/platform/utils.h:186: if (old_data != 0) {
On 2013/06/04 20:15:58, srdjan wrote:
> != NULL

Done.

https://codereview.chromium.org/16271010/diff/1/runtime/platform/utils.h#newc...
runtime/platform/utils.h:189: Utils::Minimum(old_len * sizeof(ElementType),
On 2013/06/04 20:15:58, srdjan wrote:
> Just old_len

Done.

https://codereview.chromium.org/16271010/diff/1/runtime/vm/dart_api_message.cc
File runtime/vm/dart_api_message.cc (right):

https://codereview.chromium.org/16271010/diff/1/runtime/vm/dart_api_message.c...
runtime/vm/dart_api_message.cc:809: if (forward_id_ >= forward_list_length_) {
On 2013/06/04 06:54:47, Søren Gjesse wrote:
> Not related to this change, but shouldn't this condition be
> 
>   forward_id_ == forward_list_length_
> 
> and then have 
> 
>   ASSERT(forward_id_ <= forward_list_length_)
> 
> before?

Done.

Powered by Google App Engine
This is Rietveld 408576698