diff --git a/src/system/kernel/scheduler/scheduler.cpp b/src/system/kernel/scheduler/scheduler.cpp index 9b41332d54..1971bb738b 100644 --- a/src/system/kernel/scheduler/scheduler.cpp +++ b/src/system/kernel/scheduler/scheduler.cpp @@ -84,6 +84,8 @@ static bool (*sShouldRebalance)(Thread* thread); // the core the only real concern is to make lower priority threads give way to // the higher priority threads. struct CPUEntry : public MinMaxHeapLinkImpl { + CPUEntry(); + int32 fCPUNumber; bigtime_t fMeasureActiveTime; @@ -97,6 +99,8 @@ static CPUEntry* sCPUEntries; static CPUHeap* sCPUPriorityHeaps; struct CoreEntry : public DoublyLinkedListLinkImpl { + CoreEntry(); + HeapLink fPriorityHeapLink; MinMaxHeapLink fLoadHeapLink; @@ -134,6 +138,8 @@ static CoreLoadHeap* sCoreHighLoadHeap; // idle are stored in sPackageIdleList (in LIFO manner). struct PackageEntry : public MinMaxHeapLinkImpl, DoublyLinkedListLinkImpl { + PackageEntry(); + int32 fPackageID; DoublyLinkedList fIdleCores; @@ -189,6 +195,31 @@ struct scheduler_thread_data { }; +CPUEntry::CPUEntry() + : + fMeasureActiveTime(0), + fMeasureTime(0), + fLoad(0) +{ +} + + +CoreEntry::CoreEntry() + : + fActiveTime(0), + fLoad(0) +{ +} + + +PackageEntry::PackageEntry() + : + fIdleCoreCount(0), + fCoreCount(0) +{ +} + + void scheduler_thread_data::Init() { @@ -1746,8 +1777,6 @@ _scheduler_init() for (int32 i = 0; i < coreCount; i++) { sCoreEntries[i].fCoreID = i; - sCoreEntries[i].fActiveTime = 0; - sCoreEntries[i].fLoad = 0; status_t result = sCoreLoadHeap->Insert(&sCoreEntries[i], 0); if (result != B_OK) @@ -1767,10 +1796,6 @@ _scheduler_init() for (int32 i = 0; i < cpuCount; i++) { sCPUEntries[i].fCPUNumber = i; - sCPUEntries[i].fMeasureActiveTime = 0; - sCPUEntries[i].fMeasureTime = 0; - sCPUEntries[i].fLoad = 0; - int32 core = sCPUToCore[i]; int32 package = sCPUToPackage[i];