cpp

Coverage Report

Created: 2022-11-10 11:34

/home/andy/git/oilshell/oil/mycpp/gc_heap.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef GC_HEAP_H
2
#define GC_HEAP_H
3
4
#include "mycpp/bump_leak_heap.h"
5
#include "mycpp/marksweep_heap.h"
6
7
#if defined(MARK_SWEEP)
8
3
  #define PRINT_GC_MODE_STRING() printf("  -- GC_MODE :: marksweep\n")
9
#elif defined(BUMP_LEAK)
10
  #define PRINT_GC_MODE_STRING() printf("  -- GC_MODE :: bumpleak\n")
11
#else
12
  #define PRINT_GC_MODE_STRING() printf("  -- GC_MODE :: cheney\n")
13
#endif
14
15
class RootingScope {
16
  // Create an instance of this in every function.  This lets the GC now when
17
  // functions return, so it can remove values from the root set.
18
19
 public:
20
319
  RootingScope() {
21
319
#if !defined(BUMP_LEAK)
22
319
    gHeap.root_set_.PushScope();
23
319
#endif
24
319
  }
25
319
  ~RootingScope() {
26
319
#if !defined(BUMP_LEAK)
27
319
    gHeap.root_set_.PopScope();
28
319
#endif
29
319
  }
30
};
31
32
// Variadic templates:
33
// https://eli.thegreenplace.net/2014/variadic-templates-in-c/
34
template <typename T, typename... Args>
35
881
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
881
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
881
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
881
}
_Z5AllocI4ListIP3StrEJEEPT_DpOT0_
Line
Count
Source
35
98
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
98
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
98
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
98
}
_Z5AllocI4ListIiEJEEPT_DpOT0_
Line
Count
Source
35
332
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
332
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
332
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
332
}
_Z5AllocI4ListIbEJEEPT_DpOT0_
Line
Count
Source
35
3
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
3
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
3
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
3
}
_Z5AllocI4ListIdEJEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocI4DictIiP3StrEJEEPT_DpOT0_
Line
Count
Source
35
3
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
3
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
3
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
3
}
Unexecuted instantiation: _Z5AllocI8KeyErrorJEEPT_DpOT0_
_Z5AllocI4DictIP3StriEJEEPT_DpOT0_
Line
Count
Source
35
10
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
10
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
10
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
10
}
_Z5AllocI4DictIP3StrS2_EJEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocI10IndexErrorJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI7OSErrorJiEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI12RuntimeErrorJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN5mylib15CFileLineReaderEJRP8_IO_FILEEEPT_DpOT0_
Line
Count
Source
35
4
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
4
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
4
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
4
}
_Z5AllocI10ValueErrorJEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
Unexecuted instantiation: _Z5AllocI7IOErrorJRiEEPT_DpOT0_
_Z5AllocI4DictIiiEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI5PointJiiEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocI4LineJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI10DerivedObjJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN5mylib9BufWriterEJEEPT_DpOT0_
Line
Count
Source
35
36
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
36
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
36
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
36
}
_Z5AllocIN5mylib13BufLineReaderEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN5mylib11CFileWriterEJRP8_IO_FILEEEPT_DpOT0_
Line
Count
Source
35
4
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
4
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
4
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
4
}
_Z5AllocI6Tuple2IiiEJiiEEPT_DpOT0_
Line
Count
Source
35
5
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
5
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
5
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
5
}
_Z5AllocI6Tuple2IiP3StrEJiS2_EEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI6Tuple3IiP3StrS2_EJiS2_S2_EEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI6Tuple4IiP3StrS2_iEJiS2_S2_iEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI4NodeJEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocI6Tuple2IiP3StrEJiRS2_EEPT_DpOT0_
Line
Count
Source
35
7
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
7
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
7
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
7
}
_Z5AllocI6Tuple2IiPS0_IiP3StrEEJiRS4_EEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN14asdl_generated17arith_expr__ConstEJiEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
Unexecuted instantiation: _Z5AllocIN14asdl_generated17arith_expr__ConstEJRiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI19NotImplementedErrorJEEPT_DpOT0_
_Z5AllocIN7classes10TextOutputEJRPN5mylib6WriterEEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7classes4BaseEJDnEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7classes8DerivedIEJDniEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7classes9DerivedSSEJDnRP3StrS4_EEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
Unexecuted instantiation: _Z5AllocIN7classes10TextOutputEJRPN5mylib9BufWriterEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN7classes4NodeEJDniEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN7classes4NodeEJRPS1_RiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN7classes8DerivedIEJRPNS0_4BaseERiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN7classes9DerivedSSEJRPNS0_8DerivedIERP3StrS7_EEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN7classes4BaseEJRPNS0_9DerivedSSEEEPT_DpOT0_
_Z5AllocIN10containers5PointEJiiEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN12control_flow10ParseErrorEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI6Tuple2IP3StriEJRS2_iEEPT_DpOT0_
Line
Count
Source
35
3
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
3
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
3
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
3
}
_Z5AllocI4ListIP6Tuple2IP3StriEEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI4ListIP6Tuple2IiP3StrEEJEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocIN7modules3DogEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7module13CatEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7modules6SphinxEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocI4ListIPN10hnode_asdl5fieldEEJEEPT_DpOT0_
Line
Count
Source
35
34
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
34
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
34
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
34
}
_Z5AllocI4ListIPN10hnode_asdl7hnode_tEEJEEPT_DpOT0_
Line
Count
Source
35
34
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
34
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
34
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
34
}
_Z5AllocIN10hnode_asdl13hnode__RecordEJRP3StrP4ListIPNS0_5fieldEEbS4_S4_PS5_IPNS0_7hnode_tEEEEPT_DpOT0_
Line
Count
Source
35
34
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
34
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
34
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
34
}
Unexecuted instantiation: _Z5AllocIN10hnode_asdl11hnode__LeafEJRP3StrNS0_7color_eEEEPT_DpOT0_
_Z5AllocIN10hnode_asdl11hnode__LeafEJRP3StrRNS0_7color_eEEEPT_DpOT0_
Line
Count
Source
35
20
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
20
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
20
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
20
}
Unexecuted instantiation: _Z5AllocIN6format10AnsiOutputEJRPN5mylib6WriterEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN6format10TextOutputEJRPN5mylib6WriterEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN6format10TextOutputEJPN5mylib9BufWriterEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN6format10HtmlOutputEJPN5mylib9BufWriterEEEPT_DpOT0_
_Z5AllocIN6format10AnsiOutputEJPN5mylib9BufWriterEEEPT_DpOT0_
Line
Count
Source
35
31
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
31
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
31
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
31
}
_Z5AllocI6Tuple2IP3StriEJRS2_RiEEPT_DpOT0_
Line
Count
Source
35
22
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
22
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
22
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
22
}
_Z5AllocIN6format14_PrettyPrinterEJiEEPT_DpOT0_
Line
Count
Source
35
8
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
8
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
8
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
8
}
_Z5AllocIN5parse10ParseErrorEJP3StrEEPT_DpOT0_
Line
Count
Source
35
5
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
5
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
5
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
5
}
_Z5AllocIN9expr_asdl9expr__VarEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
9
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
9
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
9
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
9
}
_Z5AllocIN9expr_asdl11expr__ConstEJiEEPT_DpOT0_
Line
Count
Source
35
14
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
14
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
14
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
14
}
_Z5AllocIN9expr_asdl12expr__BinaryEJRP3StrRPNS0_6expr_tES7_EEPT_DpOT0_
Line
Count
Source
35
14
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
14
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
14
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
14
}
_Z5AllocIN5parse5LexerEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
14
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
14
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
14
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
14
}
_Z5AllocIN5parse6ParserEJRPNS0_5LexerEEEPT_DpOT0_
Line
Count
Source
35
13
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
13
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
13
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
13
}
_Z5AllocIN6format10AnsiOutputEJPN5mylib6WriterEEEPT_DpOT0_
Line
Count
Source
35
8
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
8
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
8
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
8
}
_Z5AllocIN10hnode_asdl11hnode__LeafEJP3StrNS0_7color_eEEEPT_DpOT0_
Line
Count
Source
35
14
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
14
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
14
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
14
}
_Z5AllocIN10hnode_asdl5fieldEJP3StrRPNS0_7hnode_tEEEPT_DpOT0_
Line
Count
Source
35
60
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
60
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
60
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
60
}
_Z5AllocIN15scoped_resource7MyErrorEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN15scoped_resource8DirStackEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN7strings3FooEJEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
_Z5AllocIN9test_cast11ColorOutputEJRPN5mylib9BufWriterEEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
Unexecuted instantiation: _Z5AllocIN10hnode_asdl12hnode__ArrayEJP4ListIPNS0_7hnode_tEEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN10hnode_asdl5fieldEJP3StrRPNS0_12hnode__ArrayEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN10hnode_asdl15hnode__ExternalEJRPvEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN12runtime_asdl10assign_argEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN12runtime_asdl12part_value_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN12runtime_asdl7value_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4DictIP3StrPN12runtime_asdl8hay_nodeEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl13compound_wordEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl11word_part_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl9command_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl6word_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl5redirEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl8env_pairEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl11assign_pairEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl6if_armEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl8case_armEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl9name_typeEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl12place_expr_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl5paramEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl11type_expr_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl7variantEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl12class_item_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl11import_nameEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl12UntypedParamEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl10TypedParamEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl5TokenEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl5speckEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl6expr_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl13comprehensionEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl20class_literal_term_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl17char_class_term_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl4re_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl9named_argEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4ListIPN11syntax_asdl11string_lineEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN12runtime_asdl11value__BoolEJRbEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN12runtime_asdl10value__IntEJRiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN12runtime_asdl12value__FloatEJRfEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN12runtime_asdl12value__UndefEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN12runtime_asdl10value__StrEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args11SetToStringEJP3StrbRP4ListIS3_EEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args11SetToStringEJP3StrbDnEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args8SetToIntEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args10SetToFloatEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args9SetToTrueEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args15SetAttachedBoolEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args9SetOptionEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args14SetNamedOptionEJbEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args9SetActionEJP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args14SetNamedActionEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN9flag_spec9_FlagSpecEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4DictIP3StrPN4args7_ActionEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI4DictIP3StrPN12runtime_asdl7value_tEEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN9flag_spec16_FlagSpecAndMoreEJEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN4args6ReaderEJRP4ListIP3StrERPS2_IiEEEPT_DpOT0_
_Z5AllocIN5match11SimpleLexerEJPFvPKhiiPiS4_ERP3StrEEPT_DpOT0_
Line
Count
Source
35
2
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
2
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
2
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
2
}
_Z5AllocIN5error12FatalRuntimeEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
Unexecuted instantiation: _Z5AllocIN5error5ParseEJRP3StrRiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error5ParseEJRP3StrRPN11syntax_asdl5TokenEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error5ParseEJRP3StrRPN11syntax_asdl11word_part_tEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error5ParseEJRP3StrRPN11syntax_asdl6word_tEEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error12FatalRuntimeEJRiRP3StrEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error5UsageEJRP3StriEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocIN5error5UsageEJRP3StrRiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI7OSErrorJRiEEPT_DpOT0_
Unexecuted instantiation: _Z5AllocI12RuntimeErrorJP3StrEEPT_DpOT0_
_Z5AllocIN5error6StrictEJRP3StrEEPT_DpOT0_
Line
Count
Source
35
1
T* Alloc(Args&&... args) {
36
  // RootingScope omitted for PASS THROUGH
37
38
1
  assert(gHeap.is_initialized_);
39
0
  void* place = gHeap.Allocate(sizeof(T));
40
1
  assert(place != nullptr);
41
  // placement new
42
0
  return new (place) T(std::forward<Args>(args)...);
43
1
}
Unexecuted instantiation: _Z5AllocIN6pyutil15_ResourceLoaderEJEEPT_DpOT0_
44
45
class StackRoots {
46
 public:
47
62.8k
  StackRoots(std::initializer_list<void*> roots) {
48
62.8k
    n_ = roots.size();
49
65.3k
    for (auto root : roots) {  // can't use roots[i]
50
65.3k
      gHeap.PushRoot(reinterpret_cast<Obj**>(root));
51
65.3k
    }
52
62.8k
  }
53
54
62.8k
  ~StackRoots() {
55
128k
    for (int i = 0; i < n_; ++i) {
56
65.3k
      gHeap.PopRoot();
57
65.3k
    }
58
62.8k
  }
59
60
 private:
61
  int n_;
62
};
63
64
// LayoutForwarded and LayoutFixed aren't real types.  You can cast arbitrary
65
// objs to them to access a HOMOGENEOUS REPRESENTATION useful for garbage
66
// collection.
67
68
class LayoutForwarded : public Obj {
69
 public:
70
  Obj* new_location;  // valid if and only if heap_tag_ == Tag::Forwarded
71
};
72
73
// for Tag::FixedSize
74
class LayoutFixed : public Obj {
75
 public:
76
  Obj* children_[16];  // only the entries denoted in field_mask will be valid
77
};
78
79
#endif  // GC_HEAP_H