Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/profiler/profile-generator.h

Issue 2655963003: [profiler] Fix a memory leak of CodeEvent objects (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PROFILER_PROFILE_GENERATOR_H_ 5 #ifndef V8_PROFILER_PROFILE_GENERATOR_H_
6 #define V8_PROFILER_PROFILE_GENERATOR_H_ 6 #define V8_PROFILER_PROFILE_GENERATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // Accessed by VM thread and profile generator thread. 361 // Accessed by VM thread and profile generator thread.
362 List<CpuProfile*> current_profiles_; 362 List<CpuProfile*> current_profiles_;
363 base::Semaphore current_profiles_semaphore_; 363 base::Semaphore current_profiles_semaphore_;
364 364
365 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection); 365 DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection);
366 }; 366 };
367 367
368 368
369 class ProfileGenerator { 369 class ProfileGenerator {
370 public: 370 public:
371 ProfileGenerator(Isolate* isolate, CpuProfilesCollection* profiles); 371 explicit ProfileGenerator(CpuProfilesCollection* profiles);
372 372
373 void RecordTickSample(const TickSample& sample); 373 void RecordTickSample(const TickSample& sample);
374 374
375 CodeMap* code_map() { return &code_map_; } 375 CodeMap* code_map() { return &code_map_; }
376 376
377 private: 377 private:
378 CodeEntry* FindEntry(void* address); 378 CodeEntry* FindEntry(void* address);
379 CodeEntry* EntryForVMState(StateTag tag); 379 CodeEntry* EntryForVMState(StateTag tag);
380 380
381 Isolate* isolate_;
382 CpuProfilesCollection* profiles_; 381 CpuProfilesCollection* profiles_;
383 CodeMap code_map_; 382 CodeMap code_map_;
384 383
385 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); 384 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
386 }; 385 };
387 386
388 387
389 } // namespace internal 388 } // namespace internal
390 } // namespace v8 389 } // namespace v8
391 390
392 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ 391 #endif // V8_PROFILER_PROFILE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698