Remove hacky timer hacks

This commit is contained in:
wheremyfoodat 2023-08-31 22:47:43 +03:00
parent ce58b9cc2f
commit cb3f7fa134
3 changed files with 1 additions and 12 deletions

View file

@ -36,7 +36,6 @@ class Kernel {
std::vector<KernelObject> objects;
std::vector<Handle> portHandles;
std::vector<Handle> mutexHandles;
std::vector<Handle> timerHandles;
// Thread indices, sorted by priority
std::vector<int> threadIndices;
@ -187,14 +186,6 @@ public:
void requireReschedule() { needReschedule = true; }
void evalReschedule() {
for (auto handle : timerHandles) {
const auto object = getObject(handle, KernelObjectType::Timer);
if (object != nullptr) {
Timer* timer = object->getData<Timer>();
updateTimer(handle, timer);
}
}
if (needReschedule) {
needReschedule = false;
rescheduleThreads();

View file

@ -7,7 +7,6 @@ Kernel::Kernel(CPU& cpu, Memory& mem, GPU& gpu, const EmulatorConfig& config)
: cpu(cpu), regs(cpu.regs()), mem(mem), handleCounter(0), serviceManager(regs, mem, gpu, currentProcess, *this, config) {
objects.reserve(512); // Make room for a few objects to avoid further memory allocs later
mutexHandles.reserve(8);
timerHandles.reserve(8);
portHandles.reserve(32);
threadIndices.reserve(appResourceLimits.maxThreads);
@ -149,7 +148,6 @@ void Kernel::reset() {
}
objects.clear();
mutexHandles.clear();
timerHandles.clear();
portHandles.clear();
threadIndices.clear();
serviceManager.reset();

View file

@ -9,7 +9,7 @@ Handle Kernel::makeTimer(ResetType type) {
Helpers::panic("Created pulse timer");
}
timerHandles.push_back(ret);
// timerHandles.push_back(ret);
return ret;
}