Sha256: 1d4c5080bd0954d0581f85c0223baba69c9c001145fbbb33cf848738ca40d50f

Contents?: true

Size: 630 Bytes

Versions: 5

Compression:

Stored size: 630 Bytes

Contents

// Copyright 2006-2008 the V8 project authors. All rights reserved.
//
// Tests of the TokenLock class from lock.h

#include <stdlib.h>

#include "v8.h"

#include "platform.h"
#include "cctest.h"

using namespace ::v8::internal;


TEST(VirtualMemory) {
  OS::Setup();
  VirtualMemory* vm = new VirtualMemory(1 * MB);
  CHECK(vm->IsReserved());
  void* block_addr = vm->address();
  size_t block_size = 4 * KB;
  CHECK(vm->Commit(block_addr, block_size, false));
  // Check whether we can write to memory.
  int* addr = static_cast<int*>(block_addr);
  addr[KB-1] = 2;
  CHECK(vm->Uncommit(block_addr, block_size));
  delete vm;
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mustang-0.2.2 vendor/v8/test/cctest/test-platform-win32.cc
mustang-0.2.1 vendor/v8/test/cctest/test-platform-win32.cc
mustang-0.2.0 vendor/v8/test/cctest/test-platform-win32.cc
mustang-0.1.1 vendor/v8/test/cctest/test-platform-win32.cc
mustang-0.1.0 vendor/v8/test/cctest/test-platform-win32.cc