[K/N] Implement GCScheduler
This commit is contained in:
committed by
Space
parent
a8d321db63
commit
d03a7993ed
@@ -298,11 +298,11 @@ extern "C" void Kotlin_native_internal_GC_setThreshold(ObjHeader*, int32_t value
|
||||
if (value < 0) {
|
||||
ThrowIllegalArgumentException();
|
||||
}
|
||||
mm::GlobalData::Instance().gc().SetThreshold(static_cast<size_t>(value));
|
||||
mm::GlobalData::Instance().gcScheduler().config().threshold = static_cast<size_t>(value);
|
||||
}
|
||||
|
||||
extern "C" int32_t Kotlin_native_internal_GC_getThreshold(ObjHeader*) {
|
||||
auto threshold = mm::GlobalData::Instance().gc().GetThreshold();
|
||||
auto threshold = mm::GlobalData::Instance().gcScheduler().config().threshold.load();
|
||||
auto maxValue = std::numeric_limits<int32_t>::max();
|
||||
if (threshold > static_cast<size_t>(maxValue)) {
|
||||
return maxValue;
|
||||
@@ -324,11 +324,11 @@ extern "C" void Kotlin_native_internal_GC_setThresholdAllocations(ObjHeader*, in
|
||||
if (value < 0) {
|
||||
ThrowIllegalArgumentException();
|
||||
}
|
||||
mm::GlobalData::Instance().gc().SetAllocationThresholdBytes(static_cast<size_t>(value));
|
||||
mm::GlobalData::Instance().gcScheduler().config().allocationThresholdBytes = static_cast<size_t>(value);
|
||||
}
|
||||
|
||||
extern "C" int64_t Kotlin_native_internal_GC_getThresholdAllocations(ObjHeader*) {
|
||||
auto threshold = mm::GlobalData::Instance().gc().GetAllocationThresholdBytes();
|
||||
auto threshold = mm::GlobalData::Instance().gcScheduler().config().allocationThresholdBytes.load();
|
||||
auto maxValue = std::numeric_limits<int64_t>::max();
|
||||
if (threshold > static_cast<size_t>(maxValue)) {
|
||||
return maxValue;
|
||||
@@ -337,11 +337,11 @@ extern "C" int64_t Kotlin_native_internal_GC_getThresholdAllocations(ObjHeader*)
|
||||
}
|
||||
|
||||
extern "C" void Kotlin_native_internal_GC_setTuneThreshold(ObjHeader*, KBoolean value) {
|
||||
mm::GlobalData::Instance().gc().SetAutoTune(value);
|
||||
mm::GlobalData::Instance().gcScheduler().config().autoTune = value;
|
||||
}
|
||||
|
||||
extern "C" KBoolean Kotlin_native_internal_GC_getTuneThreshold(ObjHeader*) {
|
||||
return mm::GlobalData::Instance().gc().GetAutoTune();
|
||||
return mm::GlobalData::Instance().gcScheduler().config().autoTune.load();
|
||||
}
|
||||
|
||||
extern "C" OBJ_GETTER(Kotlin_native_internal_GC_detectCycles, ObjHeader*) {
|
||||
|
||||
Reference in New Issue
Block a user