Skip to content

Commit 46a911b

Browse files
committed
Minor fixes
1 parent c005ba1 commit 46a911b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/snmalloc/global/scopedalloc.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ namespace snmalloc
6060
*/
6161
~ScopedAllocator()
6262
{
63-
alloc->flush();
64-
AllocPool<typename SAlloc::Config>::release(alloc);
65-
alloc = nullptr;
63+
if (alloc != nullptr)
64+
{
65+
alloc->flush();
66+
AllocPool<typename SAlloc::Config>::release(alloc);
67+
alloc = nullptr;
68+
}
6669
}
6770

6871
/**

src/snmalloc/mem/corealloc.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -1335,11 +1335,10 @@ namespace snmalloc
13351335
continue;
13361336

13371337
// All elements should have the same entry.
1338-
const auto& entry =
1339-
Config::Backend::get_metaentry(small_fast_free_lists[i].peek());
1338+
const auto& entry = Config::Backend::get_metaentry(
1339+
address_cast(small_fast_free_lists[i].peek()));
13401340
do
13411341
{
1342-
// return each element
13431342
auto p = small_fast_free_lists[i].take(key, domesticate);
13441343
SNMALLOC_ASSERT(is_start_of_object(
13451344
sizeclass_t::from_small_class(i), address_cast(p)));

src/test/func/thread_alloc_external/thread_alloc_external.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main()
7171
snmalloc::dealloc(r1);
7272
}
7373

74-
snmalloc::debug_teardown();
74+
// snmalloc::debug_teardown();
7575

7676
// This checks that the scoped allocator does not call
7777
// register clean up, as this configuration will fault

0 commit comments

Comments
 (0)