Skip to content

Commit a2b56f9

Browse files
committed
Remove a notify_using that regressed perf
The performance on Windows was significantly regressed by the notify_using during the bump allocation. This change removes that. It appears that the pages are already committed by the large allocator.
1 parent 0affc06 commit a2b56f9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/mem/slab.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ namespace snmalloc
6868
}
6969
else
7070
{
71+
// Allocate the last object on the current page if there is one,
72+
// and then thread the next free list worth of allocations.
73+
bool crossed_page_boundary = false;
7174
void* curr = nullptr;
72-
bool commit = false;
7375
while (true)
7476
{
7577
size_t newbumpptr = bumpptr + rsize;
@@ -78,15 +80,12 @@ namespace snmalloc
7880

7981
if (alignedbumpptr != alignednewbumpptr)
8082
{
81-
// We have committed once already.
82-
if (commit)
83+
// We have crossed a page boundary already, so
84+
// lets stop building our free list.
85+
if (crossed_page_boundary)
8386
break;
8487

85-
memory_provider.template notify_using<NoZero>(
86-
pointer_offset(this, alignedbumpptr),
87-
alignednewbumpptr - alignedbumpptr);
88-
89-
commit = true;
88+
crossed_page_boundary = true;
9089
}
9190

9291
if (curr == nullptr)

0 commit comments

Comments
 (0)