Skip to content

Commit

Permalink
Avoid hardcoding some sublist counts
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 4, 2024
1 parent 9be3721 commit 2c9e9fd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion al/auxeffectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ bool EnsureEffectSlots(ALCcontext *context, size_t needed)
sublist.FreeMask = ~0_u64;
sublist.EffectSlots = SubListAllocator{}.allocate(1);
context->mEffectSlotList.emplace_back(std::move(sublist));
count += 64;
count += std::tuple_size_v<SubListAllocator::value_type>;
}
}
catch(...) {
Expand Down
2 changes: 1 addition & 1 deletion al/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bool EnsureBuffers(ALCdevice *device, size_t needed)
sublist.FreeMask = ~0_u64;
sublist.Buffers = SubListAllocator{}.allocate(1);
device->BufferList.emplace_back(std::move(sublist));
count += 64;
count += std::tuple_size_v<SubListAllocator::value_type>;
}
}
catch(...) {
Expand Down
2 changes: 1 addition & 1 deletion al/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ bool EnsureEffects(ALCdevice *device, size_t needed)
sublist.FreeMask = ~0_u64;
sublist.Effects = SubListAllocator{}.allocate(1);
device->EffectList.emplace_back(std::move(sublist));
count += 64;
count += std::tuple_size_v<SubListAllocator::value_type>;
}
}
catch(...) {
Expand Down
2 changes: 1 addition & 1 deletion al/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool EnsureFilters(ALCdevice *device, size_t needed)
sublist.FreeMask = ~0_u64;
sublist.Filters = SubListAllocator{}.allocate(1);
device->FilterList.emplace_back(std::move(sublist));
count += 64;
count += std::tuple_size_v<SubListAllocator::value_type>;
}
}
catch(...) {
Expand Down
2 changes: 1 addition & 1 deletion al/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ bool EnsureSources(ALCcontext *context, size_t needed)
sublist.FreeMask = ~0_u64;
sublist.Sources = SubListAllocator{}.allocate(1);
context->mSourceList.emplace_back(std::move(sublist));
count += 64;
count += std::tuple_size_v<SubListAllocator::value_type>;
}
}
catch(...) {
Expand Down

0 comments on commit 2c9e9fd

Please sign in to comment.