OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 SoftAtHome. All rights reserved. | 2 * Copyright (C) 2012 SoftAtHome. 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... |
27 #define MallocStatistics_h | 27 #define MallocStatistics_h |
28 | 28 |
29 #include "heap/Handle.h" | 29 #include "heap/Handle.h" |
30 #include "wtf/FastMalloc.h" | 30 #include "wtf/FastMalloc.h" |
31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
32 #include "wtf/RefCounted.h" | 32 #include "wtf/RefCounted.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 class MallocStatistics : public RefCountedWillBeGarbageCollected<MallocStatistic
s> { | 36 class MallocStatistics : public RefCountedWillBeGarbageCollected<MallocStatistic
s> { |
37 DECLARE_GC_INFO; | |
38 public: | 37 public: |
39 static PassRefPtrWillBeRawPtr<MallocStatistics> create() | 38 static PassRefPtrWillBeRawPtr<MallocStatistics> create() |
40 { | 39 { |
41 return adoptRefWillBeNoop(new MallocStatistics()); | 40 return adoptRefWillBeNoop(new MallocStatistics()); |
42 } | 41 } |
43 | 42 |
44 size_t reservedVMBytes() const { return m_stats.reservedVMBytes; } | 43 size_t reservedVMBytes() const { return m_stats.reservedVMBytes; } |
45 size_t committedVMBytes() const { return m_stats.committedVMBytes; } | 44 size_t committedVMBytes() const { return m_stats.committedVMBytes; } |
46 size_t freeListBytes() const { return m_stats.freeListBytes; } | 45 size_t freeListBytes() const { return m_stats.freeListBytes; } |
47 | 46 |
48 void trace(Visitor*) { } | 47 void trace(Visitor*) { } |
49 | 48 |
50 private: | 49 private: |
51 MallocStatistics() | 50 MallocStatistics() |
52 { | 51 { |
53 m_stats = WTF::fastMallocStatistics(); | 52 m_stats = WTF::fastMallocStatistics(); |
54 } | 53 } |
55 | 54 |
56 WTF::FastMallocStatistics m_stats; | 55 WTF::FastMallocStatistics m_stats; |
57 }; | 56 }; |
58 | 57 |
59 } // namespace WebCore | 58 } // namespace WebCore |
60 | 59 |
61 #endif | 60 #endif |
OLD | NEW |