Skip to content

Commit d79a818

Browse files
nwf-msrmjp41
authored andcommitted
AddressSpaceManager is not a PAL
1 parent bf3c99d commit d79a818

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/mem/address_space.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace snmalloc
1414
* usual complexity of a buddy allocator.
1515
*/
1616
template<SNMALLOC_CONCEPT(ConceptPAL) PAL>
17-
class AddressSpaceManager : public PAL
17+
class AddressSpaceManager
1818
{
1919
/**
2020
* Stores the blocks of address space
@@ -181,8 +181,7 @@ namespace snmalloc
181181
if constexpr (pal_supports<AlignedAllocation, PAL>)
182182
{
183183
if (size >= PAL::minimum_alloc_size)
184-
return static_cast<PAL*>(this)->template reserve_aligned<committed>(
185-
size);
184+
return PAL::template reserve_aligned<committed>(size);
186185
}
187186

188187
void* res;
@@ -197,17 +196,15 @@ namespace snmalloc
197196
if constexpr (pal_supports<AlignedAllocation, PAL>)
198197
{
199198
block_size = PAL::minimum_alloc_size;
200-
block = static_cast<PAL*>(this)->template reserve_aligned<false>(
201-
block_size);
199+
block = PAL::template reserve_aligned<false>(block_size);
202200
}
203201
else
204202
{
205203
// Need at least 2 times the space to guarantee alignment.
206204
// Hold lock here as a race could cause additional requests to
207205
// the PAL, and this could lead to suprious OOM. This is
208206
// particularly bad if the PAL gives all the memory on first call.
209-
auto block_and_size =
210-
static_cast<PAL*>(this)->reserve_at_least(size * 2);
207+
auto block_and_size = PAL::reserve_at_least(size * 2);
211208
block = block_and_size.first;
212209
block_size = block_and_size.second;
213210

0 commit comments

Comments
 (0)