OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // increase even though the sum of the allocated object sizes decreases. It | 416 // increase even though the sum of the allocated object sizes decreases. It |
417 // also means that the memory use depends on the kernel and stdlib. | 417 // also means that the memory use depends on the kernel and stdlib. |
418 static intptr_t MemoryInUse() { | 418 static intptr_t MemoryInUse() { |
419 intptr_t memory_use = 0; | 419 intptr_t memory_use = 0; |
420 | 420 |
421 int fd = open("/proc/self/maps", O_RDONLY); | 421 int fd = open("/proc/self/maps", O_RDONLY); |
422 if (fd < 0) return -1; | 422 if (fd < 0) return -1; |
423 | 423 |
424 const int kBufSize = 10000; | 424 const int kBufSize = 10000; |
425 char buffer[kBufSize]; | 425 char buffer[kBufSize]; |
426 int length = read(fd, buffer, kBufSize); | 426 ssize_t length = read(fd, buffer, kBufSize); |
427 intptr_t line_start = 0; | 427 intptr_t line_start = 0; |
428 CHECK_LT(length, kBufSize); // Make the buffer bigger. | 428 CHECK_LT(length, kBufSize); // Make the buffer bigger. |
429 CHECK_GT(length, 0); // We have to find some data in the file. | 429 CHECK_GT(length, 0); // We have to find some data in the file. |
430 while (line_start < length) { | 430 while (line_start < length) { |
431 if (buffer[line_start] == '\n') { | 431 if (buffer[line_start] == '\n') { |
432 line_start++; | 432 line_start++; |
433 continue; | 433 continue; |
434 } | 434 } |
435 intptr_t position = line_start; | 435 intptr_t position = line_start; |
436 uintptr_t start = ReadLong(buffer, &position, 16); | 436 uintptr_t start = ReadLong(buffer, &position, 16); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 | 484 |
485 TEST(RegressJoinThreadsOnIsolateDeinit) { | 485 TEST(RegressJoinThreadsOnIsolateDeinit) { |
486 intptr_t size_limit = ShortLivingIsolate() * 2; | 486 intptr_t size_limit = ShortLivingIsolate() * 2; |
487 for (int i = 0; i < 10; i++) { | 487 for (int i = 0; i < 10; i++) { |
488 CHECK_GT(size_limit, ShortLivingIsolate()); | 488 CHECK_GT(size_limit, ShortLivingIsolate()); |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 #endif // __linux__ and !USE_SIMULATOR | 492 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |