Commit Graph

16 Commits

Author SHA1 Message Date
Ryan Macnak cff0e751a5 [vm] Add Dart_NewExternalTypedDataWithFinalizer.
Allows the finalizer to be associated with the correct object when creating ByteData. The finalizer should be associated with the underlying ExternalUint8List, since it can outlive the ByteData via byteData.buffer.asUint8List()

Bug: b/78150644
Change-Id: I3db58792bbe3abf7ed41d2adaf225fa554b8fb25
Reviewed-on: https://dart-review.googlesource.com/52860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-01 01:57:41 +00:00
Alexander Markov c1212311bf [VM] Fix OOM handling when allocating buffers in dart:io
Reland 1d6c1020c9 with the fix for ASAN
bots.

* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

* Updated test point is extracted to a separate test
  standalone_2/file_error2_test as it needs custom ASAN options.

Change-Id: Ifb1fa59828f36dc03d45c18a41d45da6b989d70a
Reviewed-on: https://dart-review.googlesource.com/20908
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-15 18:06:31 +00:00
Alexander Markov f28005819b Revert "[VM] Fix OOM handling when allocating buffers in dart:io"
This reverts commit 1d6c1020c9.

Reason: failures on ASAN bots as ASAN is not configured to
accept memory allocations with huge size.
Change-Id: Ibb3b27f60017fb42e0f36caea2262125f5bb40d0
Reviewed-on: https://dart-review.googlesource.com/20900
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-14 21:33:25 +00:00
Alexander Markov 1d6c1020c9 [VM] Fix OOM handling when allocating buffers in dart:io
* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

Change-Id: I6a9018ab86da7b163d9797d745544835dfb0f15c
Reviewed-on: https://dart-review.googlesource.com/20582
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-14 18:26:34 +00:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
koda@google.com a69d028eb3 Track external allocated memory for weak persistent handles.
The amount of external allocation is tracked per generation
and informs GC policy.

BUG=dart:11471
R=asiva@google.com

Review URL: https://codereview.chromium.org//187113003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33467 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 23:53:32 +00:00
sgjesse@google.com 959456533f Add Process.runSync for running processes synchronously
BUG=http://dartbug.com/1707

R=whesse@google.com

Review URL: https://codereview.chromium.org//21816002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26052 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 14:12:31 +00:00
iposva@google.com 1836035266 - Modify dart_api.h to be a proper C API.
- Verify that dart_api.h can be used from C
  by changing the test_extension to be a pure C file.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15689013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15772005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
asiva@google.com f930e3856b Add typed data interface to Dart API, this only changes the C++ API as dicussed in a previous email. The dart code in the library has not been changed yet.
Review URL: https://codereview.chromium.org//12255018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18846 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:43:44 +00:00
asiva@google.com c2cafbbe33 - Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
sgjesse@google.com 3130a75c97 Make all allocation of external arrays used for IO use the IOBuffer class
This will not make a difference right now, but when we start to do
something with io buffers they should originate from the same place.

R=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//11438045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15785 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 13:44:24 +00:00
sgjesse@google.com 27adbdd138 Start reading data from sockets directly into external byte arrays
This adds a new read function to Dart sockets which delivers data in a
system allocated buffer. For now just use that for socket input
streams.

The IOBuffer class does not do much at the moment, but the idea of
adding it is to be able to centralize the management of the IO
buffers. One thing I am considering here is to keep a cache of free
buffers which can be reused without freeing and re-allocating.

R=ager@google.com, ajhonsen@google.com

BUG=

Review URL: https://codereview.chromium.org//11338037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14321 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 09:56:50 +00:00