Commit b9e4bbb0 authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

Remove CcTestArrayBufferAllocator

This is almost identical to V8's default array buffer allocator.  The only
difference is that 0 byte allocations are changed into 1 byte allocations.  We
do not seem to need this behavior, so it does not seem worth maintaining yet
another allocator.

Bug: 
Change-Id: I94f45f1276958791be9a6f2405fcfba8fa6eaa38
Reviewed-on: https://chromium-review.googlesource.com/505199Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45282}
parent 68f0a47b
......@@ -214,20 +214,6 @@ static void PrintTestList(CcTest* current) {
}
class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
virtual void* Allocate(size_t length) {
void* data = AllocateUninitialized(length == 0 ? 1 : length);
return data == NULL ? data : memset(data, 0, length);
}
virtual void* AllocateUninitialized(size_t length) {
return malloc(length == 0 ? 1 : length);
}
virtual void Free(void* data, size_t length) { free(data); }
// TODO(dslomov): Remove when v8:2823 is fixed.
virtual void Free(void* data) { UNREACHABLE(); }
};
static void SuggestTestHarness(int tests) {
if (tests == 0) return;
printf("Running multiple tests in sequence is deprecated and may cause "
......@@ -277,8 +263,8 @@ int main(int argc, char* argv[]) {
v8::V8::RegisterDefaultSignalHandler();
}
CcTestArrayBufferAllocator array_buffer_allocator;
CcTest::set_array_buffer_allocator(&array_buffer_allocator);
CcTest::set_array_buffer_allocator(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());
i::PrintExtension print_extension;
v8::RegisterExtension(&print_extension);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment