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

Issue 9159066: Allocate a Dart_CMessage structure when decoding a message into C structures (Closed)

Created:
8 years, 10 months ago by Søren Gjesse
Modified:
8 years, 10 months ago
Reviewers:
turnidge, siva
CC:
reviews_dartlang.org, Mads Ager (google)
Visibility:
Public.

Description

Allocate a Dart_CMessage structure when decoding a message into C structures Changed tests to use zone allocation for C structures. R=asiva@google.com, turnidge@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=3835

Patch Set 1 #

Total comments: 20

Patch Set 2 : Addressed comments (removed the public API trimmed Dart_CMessage) #

Patch Set 3 : Removed dummy changes from dart_api_impl.cc #

Total comments: 2

Patch Set 4 : Rebased to r3834 #

Patch Set 5 : Addressed review comments from asiva@ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -134 lines) Patch
M runtime/include/dart_api.h View 1 2 3 2 chunks +10 lines, -3 lines 0 comments Download
M runtime/vm/snapshot.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M runtime/vm/snapshot.cc View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 28 chunks +193 lines, -130 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Søren Gjesse
This is based on https://chromiumcodereview.appspot.com/9303031/
8 years, 10 months ago (2012-01-31 14:46:48 UTC) #1
turnidge
http://codereview.chromium.org/9159066/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/9159066/diff/1/runtime/include/dart_api.h#newcode1437 runtime/include/dart_api.h:1437: Allocator allocator); Do we need this to be a ...
8 years, 10 months ago (2012-01-31 22:20:42 UTC) #2
siva
https://chromiumcodereview.appspot.com/9159066/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://chromiumcodereview.appspot.com/9159066/diff/1/runtime/include/dart_api.h#newcode1419 runtime/include/dart_api.h:1419: Dart_CObject** allocated; Do we need the allocated and allocated_length ...
8 years, 10 months ago (2012-02-01 01:48:36 UTC) #3
Søren Gjesse
PTAL I have now removed the public API for decoding messages, so this CL is ...
8 years, 10 months ago (2012-02-01 12:12:23 UTC) #4
siva
lgtm https://chromiumcodereview.appspot.com/9159066/diff/9001/runtime/vm/snapshot_test.cc File runtime/vm/snapshot_test.cc (right): https://chromiumcodereview.appspot.com/9159066/diff/9001/runtime/vm/snapshot_test.cc#newcode85 runtime/vm/snapshot_test.cc:85: EXPECT_EQ(Dart_CObject::kNull, cobject->type); I think there was a leak ...
8 years, 10 months ago (2012-02-02 03:46:45 UTC) #5
Søren Gjesse
8 years, 10 months ago (2012-02-02 10:49:33 UTC) #6
http://codereview.chromium.org/9159066/diff/9001/runtime/vm/snapshot_test.cc
File runtime/vm/snapshot_test.cc (right):

http://codereview.chromium.org/9159066/diff/9001/runtime/vm/snapshot_test.cc#...
runtime/vm/snapshot_test.cc:85: EXPECT_EQ(Dart_CObject::kNull, cobject->type);
On 2012/02/02 03:46:45, asiva wrote:
> I think there was a leak originally in this test case, a free of 'buffer' (The
> buffer into which the snapshot was written into) was not being done.
> Sorry about that.
> 
> free(buffer);
> 
> would be needed in all these unit tests that invoke the SnapshotWriter.
> 
> Or we could use the new zone_allocator that you have added as the allocator
for
> the SnapshotWriter too and move your Zone zone(...) declaration above the
writer
> object.
> 
> Your choice.

Changed to use zone allocator in all tests involving reading into Dart_CMessage.

Powered by Google App Engine
This is Rietveld 408576698