Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 const DumpMarkedArgs& args) { | 512 const DumpMarkedArgs& args) { |
| 513 if (v->mark() != args.mark) | 513 if (v->mark() != args.mark) |
| 514 return; | 514 return; |
| 515 Bucket b; | 515 Bucket b; |
| 516 memset(&b, 0, sizeof(b)); | 516 memset(&b, 0, sizeof(b)); |
| 517 b.allocs = 1; | 517 b.allocs = 1; |
| 518 b.alloc_size = v->bytes; | 518 b.alloc_size = v->bytes; |
| 519 b.depth = v->bucket()->depth; | 519 b.depth = v->bucket()->depth; |
| 520 b.stack = v->bucket()->stack; | 520 b.stack = v->bucket()->stack; |
| 521 char addr[16]; | 521 char addr[16]; |
| 522 snprintf(addr, 16, "0x%08" PRIxPTR, ptr); | 522 snprintf(addr, 16, "0x%08" PRIxPTR, (uintptr_t)ptr); |
|
jochen (gone - plz use gerrit)
2015/06/17 09:48:09
please use reinterpret_cast<intptr_t>
Thiemo Nagel
2015/06/17 11:22:46
Just out of curiosity: Why do you prefer intptr_t
| |
| 523 char buf[1024]; | 523 char buf[1024]; |
| 524 int len = UnparseBucket(b, buf, 0, sizeof(buf), addr, NULL); | 524 int len = UnparseBucket(b, buf, 0, sizeof(buf), addr, NULL); |
| 525 RawWrite(args.fd, buf, len); | 525 RawWrite(args.fd, buf, len); |
| 526 } | 526 } |
| 527 | 527 |
| 528 inline | 528 inline |
| 529 void HeapProfileTable::AllocationAddressesIterator( | 529 void HeapProfileTable::AllocationAddressesIterator( |
| 530 const void* ptr, | 530 const void* ptr, |
| 531 AllocValue* v, | 531 AllocValue* v, |
| 532 const AllocationAddressIteratorArgs& args) { | 532 const AllocationAddressIteratorArgs& args) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 char* unused) { | 745 char* unused) { |
| 746 // Perhaps also log the allocation stack trace (unsymbolized) | 746 // Perhaps also log the allocation stack trace (unsymbolized) |
| 747 // on this line in case somebody finds it useful. | 747 // on this line in case somebody finds it useful. |
| 748 RAW_LOG(ERROR, "leaked %" PRIuS " byte object %p", v->bytes, ptr); | 748 RAW_LOG(ERROR, "leaked %" PRIuS " byte object %p", v->bytes, ptr); |
| 749 } | 749 } |
| 750 | 750 |
| 751 void HeapProfileTable::Snapshot::ReportIndividualObjects() { | 751 void HeapProfileTable::Snapshot::ReportIndividualObjects() { |
| 752 char unused; | 752 char unused; |
| 753 map_.Iterate(ReportObject, &unused); | 753 map_.Iterate(ReportObject, &unused); |
| 754 } | 754 } |
| OLD | NEW |