- add default autolink for fmtlib in Windows

- reduce size of the executable of win-git-askpass tool
  - fix: memory size not correctly calculated when check if share parser.
  - fix: c/c++ file use different parser for share.
This commit is contained in:
Roy Qu 2022-10-28 12:43:47 +08:00
parent 2ce732cfa5
commit e987959551
6 changed files with 29 additions and 25 deletions

View File

@ -5,7 +5,8 @@ Red Panda C++ Version 2.1
- enhancement: add "editors share one code parser" in "options" / "editor" / "code completion", to reduce memory usage. - enhancement: add "editors share one code parser" in "options" / "editor" / "code completion", to reduce memory usage.
Turned off by default on PCs with memory > 4G; Force turned on PCs with memory < 1G. Turned off by default on PCs with memory > 4G; Force turned on PCs with memory < 1G.
- enhancement: add "goto block start"/"goto block end" in "Code" menu - enhancement: add "goto block start"/"goto block end" in "Code" menu
- add fmtlib to the gcc compiler's lib distributed with RedPanda IDE windows version
- add default autolink for fmtlib in Windows
Red Panda C++ Version 2.0 Red Panda C++ Version 2.0

View File

@ -3953,7 +3953,7 @@ PCppParser Editor::sharedParser(ParserLanguage language)
{ {
PCppParser parser; PCppParser parser;
if (mSharedParsers.contains(language)) { if (mSharedParsers.contains(language)) {
std::weak_ptr<CppParser> weakParser=mSharedParsers[language].lock(); parser=mSharedParsers[language].lock();
} }
if (!parser) { if (!parser) {
parser=std::make_shared<CppParser>(); parser=std::make_shared<CppParser>();

View File

@ -27,6 +27,10 @@
"header": "ege.h", "header": "ege.h",
"links": "-lgraphics -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus" "links": "-lgraphics -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus"
}, },
{
"header": "fmt/core.h",
"links": "-lfmt"
},
{ {
"execUseUTF8": true, "execUseUTF8": true,
"header": "raylib.h", "header": "raylib.h",

View File

@ -3695,9 +3695,16 @@ bool Settings::CodeCompletion::clearWhenEditorHidden()
{ {
MEMORYSTATUSEX statex; MEMORYSTATUSEX statex;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
statex.dwLength = sizeof (statex);
GlobalMemoryStatusEx (&statex);
if (statex.ullTotalPhys < (long long int)2*1024*1024*1024) { if (statex.ullTotalPhys < (long long int)2*1024*1024*1024) {
mClearWhenEditorHidden = true; mClearWhenEditorHidden = true;
} }
if (statex.ullAvailPhys < (long long int)2*1024*1024*1024) {
return true;
}
#endif #endif
return mClearWhenEditorHidden; return mClearWhenEditorHidden;
} }
@ -3732,9 +3739,17 @@ bool Settings::CodeCompletion::shareParser()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
MEMORYSTATUSEX statex; MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex);
GlobalMemoryStatusEx (&statex);
if (statex.ullTotalPhys < (long long int)1024*1024*1024) { if (statex.ullTotalPhys < (long long int)1024*1024*1024) {
mShareParser = true; mShareParser = true;
} }
if (statex.ullAvailPhys < (long long int)1*1024*1024*1024) {
return true;
}
#endif #endif
return mShareParser; return mShareParser;
} }
@ -3906,6 +3921,7 @@ void Settings::CodeCompletion::doLoad()
mHideSymbolsStartsWithUnderLine = boolValue("hide_symbols_start_with_underline", false); mHideSymbolsStartsWithUnderLine = boolValue("hide_symbols_start_with_underline", false);
bool doClear = true; bool doClear = true;
bool shouldShare=true;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
MEMORYSTATUSEX statex; MEMORYSTATUSEX statex;
@ -3913,24 +3929,15 @@ void Settings::CodeCompletion::doLoad()
statex.dwLength = sizeof (statex); statex.dwLength = sizeof (statex);
GlobalMemoryStatusEx (&statex); GlobalMemoryStatusEx (&statex);
if (statex.ullAvailPhys > (long long int)10*1024*1024*1024) { if (statex.ullAvailPhys > (long long int)16*1024*1024*1024) {
doClear = false; doClear = false;
} }
#endif if (statex.ullAvailPhys > (long long int)10*1024*1024*1024) {
mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",doClear);
bool shouldShare=true;
#ifdef Q_OS_WIN
statex.dwLength = sizeof (statex);
GlobalMemoryStatusEx (&statex);
if (statex.ullAvailPhys > (long long int)8*1024*1024*1024) {
shouldShare = false; shouldShare = false;
} }
#endif #endif
mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",doClear);
mShareParser = boolValue("share_parser",shouldShare); mShareParser = boolValue("share_parser",shouldShare);
} }

View File

@ -452,7 +452,7 @@ bool copyFile(const QString &fromPath, const QString &toPath, bool overwrite)
if (!toFile.open(QFile::WriteOnly | QFile::Truncate)) if (!toFile.open(QFile::WriteOnly | QFile::Truncate))
return false; return false;
int bufferSize=64*1024; constexpr int bufferSize=64*1024;
char buffer[bufferSize]; char buffer[bufferSize];
while (!fromFile.atEnd()) { while (!fromFile.atEnd()) {

View File

@ -1,13 +1,5 @@
#win32-msvc{ CONFIG += windows
# CONFIG += c++11 CONFIG -= qt
# CONFIG -= app_bundle
#} else {
# TEMPLATE = app
# CONFIG += windows
# CONFIG -= app_bundle
# CONFIG -= qt
#}
CONFIG += c++11 CONFIG += c++11
CONFIG -= app_bundle CONFIG -= app_bundle