17 FLAG_trace_zones =
true;
27 uintptr_t allocated_size = 0;
31 for (
int i = 0;
i < 1000;
i++) {
40 const uword kLargeSize = 1 *
MB;
41 const uword kSegmentSize = 64 *
KB;
42 ASSERT(kLargeSize > kSegmentSize);
43 for (
int i = 0;
i < 10;
i++) {
45 allocated_size += kLargeSize;
55 allocated_size += (kSegmentSize -
kWordSize);
58 buffer =
reinterpret_cast<uint8_t*
>(
62 allocated_size += (kSegmentSize - (2 *
kWordSize));
69 allocated_size += (kSegmentSize +
kWordSize);
78 FLAG_trace_zones =
true;
87 uintptr_t allocated_size = 0;
89 const intptr_t kNumElements = 1000;
91 allocated_size +=
sizeof(uint32_t) * kNumElements;
101 FLAG_trace_zones =
true;
110 const intptr_t kNumElements = (
kIntptrMax /
sizeof(uint32_t)) + 1;
122 auto zone = thread->
zone();
124 const intptr_t kOldLen = 32;
125 const intptr_t kNewLen = 16;
126 const intptr_t kNewLen2 = 16;
128 auto data_old = zone->
Alloc<uint8_t>(kOldLen);
129 auto data_new = zone->Realloc<uint8_t>(data_old, kOldLen, kNewLen);
132 auto data_new2 = zone->Realloc<uint8_t>(data_old, kNewLen, kNewLen2);
140 FLAG_trace_zones =
true;
149 SimpleZoneObject() : slot(
marker++) {}
150 virtual ~SimpleZoneObject() {}
151 virtual int GetSlot() {
return slot; }
163 SimpleZoneObject* first =
new SimpleZoneObject();
165 SimpleZoneObject* second =
new SimpleZoneObject();
166 EXPECT(second !=
nullptr);
168 uintptr_t expected_size = (2 *
sizeof(SimpleZoneObject));
172 EXPECT_EQ(0, first->slot);
173 EXPECT_EQ(1, second->slot);
178 EXPECT_EQ(42, first->slot);
179 EXPECT_EQ(87, second->slot);
189 EXPECT_STREQ(
"Hello World!",
result);
192#if !defined(PRODUCT) && !defined(USING_ADDRESS_SANITIZER) && \
193 !defined(USING_MEMORY_SANITIZER)
219#if defined(CHECK_RSS)
224 for (
size_t i = 0;
i < ((3u *
GB) / (512u *
KB));
i++) {
229 free(allocations[j]);
233#if defined(CHECK_RSS)
235 EXPECT_LT(stop_rss, start_rss +
kRssSlack);
240#if defined(CHECK_RSS)
244 for (
size_t i = 0;
i < ((3u *
GB) / (512u *
KB));
i++) {
252#if defined(CHECK_RSS)
254 EXPECT_LT(stop_rss, start_rss +
kRssSlack);
258#if defined(DART_COMPRESSED_POINTERS)
261 Zone* zone = stack_zone.GetZone();
264 while (total <= (4u *
GB)) {
274 const intptr_t n = 1000000;
281 for (intptr_t
i = 0;
i < n;
i++) {
292 for (intptr_t
i = 0;
i < n;
i++) {
static const char marker[]
#define DEBUG_ASSERT(cond)
#define RELEASE_ASSERT(cond)
static Object & ZoneHandle()
static int64_t CurrentRSS()
uintptr_t SizeInBytes() const
static Dart_Isolate CreateTestIsolate(const char *name=nullptr, void *isolate_group_data=nullptr, void *isolate_data=nullptr)
static Thread * Current()
char * PrintToString(const char *format,...) PRINTF_ATTRIBUTE(2
void * AllocUnsafe(intptr_t size)
uintptr_t SizeInBytes() const
ElementType * Alloc(intptr_t length)
#define HANDLESCOPE(thread)
static intptr_t chunk_size(intptr_t bytes_left)
void * malloc(size_t size)
VM_UNIT_TEST_CASE_WITH_EXPECTATION(BitFields_Assert, DEBUG_CRASH)
static CStringUniquePtr PrintToString(const char *format,...)
ISOLATE_UNIT_TEST_CASE(StackAllocatedDestruction)
TEST_CASE(DirectoryCurrent)
static constexpr int64_t kRssSlack
constexpr intptr_t kWordSize
static const size_t kSizes[]
DART_EXPORT void Dart_ShutdownIsolate()
constexpr intptr_t kIntptrMax
VM_UNIT_TEST_CASE(DirectoryCurrentNoScope)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
#define ARRAY_SIZE(array)