blob: 5edea95dc39573986564bd85ee0a067aa04e4d87 [file] [log] [blame]
Ian Rogers1d54e732013-05-02 21:10:01 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_GC_ACCOUNTING_HEAP_BITMAP_INL_H_
18#define ART_RUNTIME_GC_ACCOUNTING_HEAP_BITMAP_INL_H_
Ian Rogers1d54e732013-05-02 21:10:01 -070019
20#include "heap_bitmap.h"
21
22namespace art {
23namespace gc {
24namespace accounting {
25
26template <typename Visitor>
27inline void HeapBitmap::Visit(const Visitor& visitor) {
28 // TODO: C++0x auto
29 typedef std::vector<SpaceBitmap*>::iterator It;
30 for (It it = continuous_space_bitmaps_.begin(), end = continuous_space_bitmaps_.end();
31 it != end; ++it) {
32 SpaceBitmap* bitmap = *it;
33 bitmap->VisitMarkedRange(bitmap->HeapBegin(), bitmap->HeapLimit(), visitor, VoidFunctor());
34 }
35 // TODO: C++0x auto
36 typedef std::vector<SpaceSetMap*>::iterator It2;
37 DCHECK(discontinuous_space_sets_.begin() != discontinuous_space_sets_.end());
38 for (It2 it = discontinuous_space_sets_.begin(), end = discontinuous_space_sets_.end();
39 it != end; ++it) {
40 SpaceSetMap* set = *it;
41 set->Visit(visitor);
42 }
Ian Rogers1d54e732013-05-02 21:10:01 -070043}
44
45} // namespace accounting
46} // namespace gc
47} // namespace art
48
Brian Carlstromfc0e3212013-07-17 14:40:12 -070049#endif // ART_RUNTIME_GC_ACCOUNTING_HEAP_BITMAP_INL_H_