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

Side by Side Diff: Source/platform/heap/Heap.h

Issue 669323002: Oilpan: Clarify ownership of split-off heaps. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 #if ENABLE(ASSERT) 715 #if ENABLE(ASSERT)
716 virtual bool isConsistentForSweeping() = 0; 716 virtual bool isConsistentForSweeping() = 0;
717 717
718 virtual void getScannedStats(HeapStats&) = 0; 718 virtual void getScannedStats(HeapStats&) = 0;
719 #endif 719 #endif
720 720
721 virtual void prepareHeapForTermination() = 0; 721 virtual void prepareHeapForTermination() = 0;
722 722
723 virtual int normalPageCount() = 0; 723 virtual int normalPageCount() = 0;
724 724
725 virtual BaseHeap* split(int normalPages) = 0; 725 virtual PassOwnPtr<BaseHeap> split(int normalPages) = 0;
726 virtual void merge(BaseHeap* other) = 0; 726 virtual void merge(PassOwnPtr<BaseHeap> other) = 0;
727 727
728 // Returns a bucket number for inserting a FreeListEntry of a 728 // Returns a bucket number for inserting a FreeListEntry of a
729 // given size. All FreeListEntries in the given bucket, n, have 729 // given size. All FreeListEntries in the given bucket, n, have
730 // size >= 2^n. 730 // size >= 2^n.
731 static int bucketIndexForSize(size_t); 731 static int bucketIndexForSize(size_t);
732 }; 732 };
733 733
734 // Thread heaps represent a part of the per-thread Blink heap. 734 // Thread heaps represent a part of the per-thread Blink heap.
735 // 735 //
736 // Each Blink thread has a number of thread heaps: one general heap 736 // Each Blink thread has a number of thread heaps: one general heap
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 void addToFreeList(Address, size_t); 777 void addToFreeList(Address, size_t);
778 inline static size_t roundedAllocationSize(size_t size) 778 inline static size_t roundedAllocationSize(size_t size)
779 { 779 {
780 return allocationSizeFromSize(size) - sizeof(Header); 780 return allocationSizeFromSize(size) - sizeof(Header);
781 } 781 }
782 782
783 virtual void prepareHeapForTermination(); 783 virtual void prepareHeapForTermination();
784 784
785 virtual int normalPageCount() { return m_numberOfNormalPages; } 785 virtual int normalPageCount() { return m_numberOfNormalPages; }
786 786
787 virtual BaseHeap* split(int numberOfNormalPages); 787 virtual PassOwnPtr<BaseHeap> split(int numberOfNormalPages) override;
788 virtual void merge(BaseHeap* splitOffBase); 788 virtual void merge(PassOwnPtr<BaseHeap> splitOffBase) override;
789 789
790 void removePageFromHeap(HeapPage<Header>*); 790 void removePageFromHeap(HeapPage<Header>*);
791 791
792 PLATFORM_EXPORT void promptlyFreeObject(Header*); 792 PLATFORM_EXPORT void promptlyFreeObject(Header*);
793 793
794 private: 794 private:
795 void addPageToHeap(const GCInfo*); 795 void addPageToHeap(const GCInfo*);
796 PLATFORM_EXPORT Address outOfLineAllocate(size_t, const GCInfo*); 796 PLATFORM_EXPORT Address outOfLineAllocate(size_t, const GCInfo*);
797 static size_t allocationSizeFromSize(size_t); 797 static size_t allocationSizeFromSize(size_t);
798 PLATFORM_EXPORT Address allocateLargeObject(size_t, const GCInfo*); 798 PLATFORM_EXPORT Address allocateLargeObject(size_t, const GCInfo*);
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 }; 2397 };
2398 2398
2399 template<typename T> 2399 template<typename T>
2400 struct IfWeakMember<WeakMember<T> > { 2400 struct IfWeakMember<WeakMember<T> > {
2401 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); } 2401 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); }
2402 }; 2402 };
2403 2403
2404 } 2404 }
2405 2405
2406 #endif // Heap_h 2406 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698