@@ -44,14 +44,14 @@ class NodeFactory {
44
44
// / The end of the current slab.
45
45
char *End = nullptr ;
46
46
47
- struct Slab {
47
+ struct AllocatedSlab {
48
48
// The previously allocated slab.
49
- Slab *Previous;
49
+ AllocatedSlab *Previous;
50
50
// Tail allocated memory starts here.
51
51
};
52
52
53
53
// / The head of the single-linked slab list.
54
- Slab *CurrentSlab = nullptr ;
54
+ AllocatedSlab *CurrentSlab = nullptr ;
55
55
56
56
// / The size of the previously allocated slab. This may NOT be the size of
57
57
// / CurrentSlab, in the case where a checkpoint has been popped.
@@ -66,7 +66,7 @@ class NodeFactory {
66
66
& ~((uintptr_t )Alignment - 1 ));
67
67
}
68
68
69
- static void freeSlabs (Slab *slab);
69
+ static void freeSlabs (AllocatedSlab *slab);
70
70
71
71
// / If not null, the NodeFactory from which this factory borrowed free memory.
72
72
NodeFactory *BorrowedFrom = nullptr ;
@@ -149,8 +149,8 @@ class NodeFactory {
149
149
// No. We have to malloc a new slab.
150
150
// We double the slab size for each allocated slab.
151
151
SlabSize = std::max (SlabSize * 2 , ObjectSize + alignof (T));
152
- size_t AllocSize = sizeof (Slab ) + SlabSize;
153
- Slab *newSlab = (Slab *)malloc (AllocSize);
152
+ size_t AllocSize = sizeof (AllocatedSlab ) + SlabSize;
153
+ AllocatedSlab *newSlab = (AllocatedSlab *)malloc (AllocSize);
154
154
155
155
// Insert the new slab in the single-linked list of slabs.
156
156
newSlab->Previous = CurrentSlab;
@@ -225,7 +225,7 @@ class NodeFactory {
225
225
// / A checkpoint which captures the allocator's state at any given time. A
226
226
// / checkpoint can be popped to free all allocations made since it was made.
227
227
struct Checkpoint {
228
- Slab *Slab;
228
+ AllocatedSlab *Slab;
229
229
char *CurPtr;
230
230
char *End;
231
231
};
0 commit comments