| Index: runtime/vm/zone.cc
|
| diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
|
| index 9bbc8eb6b3ebabc8d4fc8fb39cd2e77035c970f7..ef35be17a87a11b8f98c779cdb3cbd71c49d1f5b 100644
|
| --- a/runtime/vm/zone.cc
|
| +++ b/runtime/vm/zone.cc
|
| @@ -43,7 +43,6 @@ class Zone::Segment {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(Segment);
|
| };
|
|
|
| -
|
| Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
|
| ASSERT(size >= 0);
|
| Segment* result = reinterpret_cast<Segment*>(malloc(size));
|
| @@ -61,7 +60,6 @@ Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
|
| return result;
|
| }
|
|
|
| -
|
| void Zone::Segment::DeleteSegmentList(Segment* head) {
|
| Segment* current = head;
|
| while (current != NULL) {
|
| @@ -76,7 +74,6 @@ void Zone::Segment::DeleteSegmentList(Segment* head) {
|
| }
|
| }
|
|
|
| -
|
| void Zone::Segment::IncrementMemoryCapacity(uintptr_t size) {
|
| Thread* current_thread = Thread::Current();
|
| if (current_thread != NULL) {
|
| @@ -87,7 +84,6 @@ void Zone::Segment::IncrementMemoryCapacity(uintptr_t size) {
|
| }
|
| }
|
|
|
| -
|
| void Zone::Segment::DecrementMemoryCapacity(uintptr_t size) {
|
| Thread* current_thread = Thread::Current();
|
| if (current_thread != NULL) {
|
| @@ -98,7 +94,6 @@ void Zone::Segment::DecrementMemoryCapacity(uintptr_t size) {
|
| }
|
| }
|
|
|
| -
|
| // TODO(bkonyi): We need to account for the initial chunk size when a new zone
|
| // is created within a new thread or ApiNativeScope when calculating high
|
| // watermarks or memory consumption.
|
| @@ -119,7 +114,6 @@ Zone::Zone()
|
| #endif
|
| }
|
|
|
| -
|
| Zone::~Zone() {
|
| if (FLAG_trace_zones) {
|
| DumpZoneSizes();
|
| @@ -128,7 +122,6 @@ Zone::~Zone() {
|
| Segment::DecrementMemoryCapacity(kInitialChunkSize);
|
| }
|
|
|
| -
|
| void Zone::DeleteAll() {
|
| // Traverse the chained list of segments, zapping (in debug mode)
|
| // and freeing every zone segment.
|
| @@ -150,7 +143,6 @@ void Zone::DeleteAll() {
|
| handles_.Reset();
|
| }
|
|
|
| -
|
| uintptr_t Zone::SizeInBytes() const {
|
| uintptr_t size = 0;
|
| for (Segment* s = large_segments_; s != NULL; s = s->next()) {
|
| @@ -166,7 +158,6 @@ uintptr_t Zone::SizeInBytes() const {
|
| return size + (position_ - head_->start());
|
| }
|
|
|
| -
|
| uintptr_t Zone::CapacityInBytes() const {
|
| uintptr_t size = 0;
|
| for (Segment* s = large_segments_; s != NULL; s = s->next()) {
|
| @@ -182,7 +173,6 @@ uintptr_t Zone::CapacityInBytes() const {
|
| return size;
|
| }
|
|
|
| -
|
| uword Zone::AllocateExpand(intptr_t size) {
|
| ASSERT(size >= 0);
|
| if (FLAG_trace_zones) {
|
| @@ -215,7 +205,6 @@ uword Zone::AllocateExpand(intptr_t size) {
|
| return result;
|
| }
|
|
|
| -
|
| uword Zone::AllocateLargeSegment(intptr_t size) {
|
| ASSERT(size >= 0);
|
| // Make sure the requested size is already properly aligned and that
|
| @@ -233,7 +222,6 @@ uword Zone::AllocateLargeSegment(intptr_t size) {
|
| return result;
|
| }
|
|
|
| -
|
| char* Zone::MakeCopyOfString(const char* str) {
|
| intptr_t len = strlen(str) + 1; // '\0'-terminated.
|
| char* copy = Alloc<char>(len);
|
| @@ -241,7 +229,6 @@ char* Zone::MakeCopyOfString(const char* str) {
|
| return copy;
|
| }
|
|
|
| -
|
| char* Zone::MakeCopyOfStringN(const char* str, intptr_t len) {
|
| ASSERT(len >= 0);
|
| for (intptr_t i = 0; i < len; i++) {
|
| @@ -256,7 +243,6 @@ char* Zone::MakeCopyOfStringN(const char* str, intptr_t len) {
|
| return copy;
|
| }
|
|
|
| -
|
| char* Zone::ConcatStrings(const char* a, const char* b, char join) {
|
| intptr_t a_len = (a == NULL) ? 0 : strlen(a);
|
| const intptr_t b_len = strlen(b) + 1; // '\0'-terminated.
|
| @@ -271,7 +257,6 @@ char* Zone::ConcatStrings(const char* a, const char* b, char join) {
|
| return copy;
|
| }
|
|
|
| -
|
| void Zone::DumpZoneSizes() {
|
| intptr_t size = 0;
|
| for (Segment* s = large_segments_; s != NULL; s = s->next()) {
|
| @@ -283,7 +268,6 @@ void Zone::DumpZoneSizes() {
|
| reinterpret_cast<intptr_t>(this), SizeInBytes(), size);
|
| }
|
|
|
| -
|
| void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
| Zone* zone = this;
|
| while (zone != NULL) {
|
| @@ -292,7 +276,6 @@ void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
| }
|
| }
|
|
|
| -
|
| char* Zone::PrintToString(const char* format, ...) {
|
| va_list args;
|
| va_start(args, format);
|
| @@ -301,12 +284,10 @@ char* Zone::PrintToString(const char* format, ...) {
|
| return buffer;
|
| }
|
|
|
| -
|
| char* Zone::VPrint(const char* format, va_list args) {
|
| return OS::VSCreate(this, format, args);
|
| }
|
|
|
| -
|
| StackZone::StackZone(Thread* thread) : StackResource(thread), zone_() {
|
| if (FLAG_trace_zones) {
|
| OS::PrintErr("*** Starting a new Stack zone 0x%" Px "(0x%" Px ")\n",
|
| @@ -317,7 +298,6 @@ StackZone::StackZone(Thread* thread) : StackResource(thread), zone_() {
|
| thread->set_zone(&zone_);
|
| }
|
|
|
| -
|
| StackZone::~StackZone() {
|
| ASSERT(thread()->zone() == &zone_);
|
| thread()->set_zone(zone_.previous_);
|
|
|