| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 unflattened_strings_length_ += length; | 453 unflattened_strings_length_ += length; |
| 454 } | 454 } |
| 455 return str; | 455 return str; |
| 456 } | 456 } |
| 457 | 457 |
| 458 | 458 |
| 459 intptr_t Heap::AdjustAmountOfExternalAllocatedMemory( | 459 intptr_t Heap::AdjustAmountOfExternalAllocatedMemory( |
| 460 intptr_t change_in_bytes) { | 460 intptr_t change_in_bytes) { |
| 461 ASSERT(HasBeenSetUp()); | 461 ASSERT(HasBeenSetUp()); |
| 462 intptr_t amount = amount_of_external_allocated_memory_ + change_in_bytes; | 462 intptr_t amount = amount_of_external_allocated_memory_ + change_in_bytes; |
| 463 if (change_in_bytes >= 0) { | 463 if (change_in_bytes > 0) { |
| 464 // Avoid overflow. | 464 // Avoid overflow. |
| 465 if (amount > amount_of_external_allocated_memory_) { | 465 if (amount > amount_of_external_allocated_memory_) { |
| 466 amount_of_external_allocated_memory_ = amount; | 466 amount_of_external_allocated_memory_ = amount; |
| 467 } else { | 467 } else { |
| 468 // Give up and reset the counters in case of an overflow. | 468 // Give up and reset the counters in case of an overflow. |
| 469 amount_of_external_allocated_memory_ = 0; | 469 amount_of_external_allocated_memory_ = 0; |
| 470 amount_of_external_allocated_memory_at_last_global_gc_ = 0; | 470 amount_of_external_allocated_memory_at_last_global_gc_ = 0; |
| 471 } | 471 } |
| 472 intptr_t amount_since_last_global_gc = PromotedExternalMemorySize(); | 472 intptr_t amount_since_last_global_gc = PromotedExternalMemorySize(); |
| 473 if (amount_since_last_global_gc > external_allocation_limit_) { | 473 if (amount_since_last_global_gc > external_allocation_limit_) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 AssertNoAllocation::~AssertNoAllocation() { } | 804 AssertNoAllocation::~AssertNoAllocation() { } |
| 805 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 805 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
| 806 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 806 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
| 807 | 807 |
| 808 #endif | 808 #endif |
| 809 | 809 |
| 810 | 810 |
| 811 } } // namespace v8::internal | 811 } } // namespace v8::internal |
| 812 | 812 |
| 813 #endif // V8_HEAP_INL_H_ | 813 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |