fix: store memoryUsed as long long instead of int#292
Open
ZnPdCo wants to merge 11 commits intoProject-LemonLime:masterfrom
Open
fix: store memoryUsed as long long instead of int#292ZnPdCo wants to merge 11 commits intoProject-LemonLime:masterfrom
ZnPdCo wants to merge 11 commits intoProject-LemonLime:masterfrom
Conversation
Contributor
Author
|
Project_LemonLime/src/core/judgingthread.cpp Lines 924 to 973 in 5abd55e 这里怎么把同样的逻辑写了两遍 |
Member
不知道,古早代码,感觉可以优化掉 |
Contributor
Author
|
修复这个 bug 可能需要进行其他修改,我会拆成多个 pr 进行修改。 |
alphagocc
reviewed
Mar 23, 2026
|
|
||
| if (qMax(memoryInfo.PrivateUsage, memoryInfo.PeakWorkingSetSize) > | ||
| config.memoryLimit * 1024U * 1024) { | ||
| 1ll * config.memoryLimit * 1024 * 1024) { |
Member
There was a problem hiding this comment.
不如把 config.memoryLimit 一起改成 i64
Contributor
Author
There was a problem hiding this comment.
这个改动量是不是稍微有些大了,不是很想去改,要改也另开一个 pr 去改吧
alphagocc
reviewed
Mar 25, 2026
| int kernelTimeUsed = realKernelTime.wMilliseconds + realKernelTime.wSecond * 1000 + | ||
| realKernelTime.wMinute * 60 * 1000 + realKernelTime.wHour * 60 * 60 * 1000; | ||
| GetProcessMemoryInfo(pi.hProcess, (PROCESS_MEMORY_COUNTERS *)&memoryInfo, sizeof(memoryInfo)); | ||
| res.memoryUsed = memoryInfo.PeakWorkingSetSize; |
| void judgingStarted(QString); | ||
| void judgingFinished(); | ||
| void dialogAlert(QString); | ||
| void singleCaseFinished(QString, int, int, int, int, int, int, int); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复 #281 中的 int 存空间问题(显示为负数),以及 Windows 下判定空间用 int 或 unsigned int 的问题(无法开 > 2GB 的空间)
注意,#281 的问题还没有完全修复。
本地使用 Windows 测试下面的代码:
(不知道为什么过了一个月再测这段代码就超空间了,动态调整一下 c 的 size 应该能行)