linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06140
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3078: fix GCC build
------------------------------------------------------------
revno: 3078
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2012-10-16 18:17:56 +0200
message:
fix GCC build
modified:
win32/DirectoryListingFrame.cpp
win32/MDIChildFrame.h
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp 2012-10-15 19:18:21 +0000
+++ win32/DirectoryListingFrame.cpp 2012-10-16 16:17:56 +0000
@@ -416,12 +416,21 @@
namespace {
/* items cached by all open file lists. caching can take up a lot of memory so we use this
counter to keep tabs on the caches and make sure they don't grow too big. */
- atomic<uint64_t> cacheCount = 0;
+ atomic<uint64_t> cacheCount(0);
- // minimum amount of items to require a cache.
+ /* minimum amount of items to require a cache. this helps skip directories that don't have many
+ files: file information for small directories is easy to build up on-the-fly without inducing
+ any GUI freeze, so we don't cache these small directories. this value can be increased as long
+ as displaying a directory with cacheLowerBound files doesn't freeze the GUI for too long. */
const uint64_t cacheLowerBound = 1024;
- // maximum amount of items all file list caches can contain.
- const uint64_t maxCacheCount = 1048576;
+
+ /* maximum amount of items all file list caches can contain. we aim for 500MB max on x86 and
+ 1GB max on x64, with the assumption that one cached item occupies around 1KB. */
+#ifdef _WIN64
+ const uint64_t maxCacheCount = 1024 * 1024;
+#else
+ const uint64_t maxCacheCount = 512 * 1024;
+#endif
template<typename T> bool canCache(T items) {
return items > cacheLowerBound && cacheCount + static_cast<uint64_t>(items) < maxCacheCount;
=== modified file 'win32/MDIChildFrame.h'
--- win32/MDIChildFrame.h 2012-10-15 16:26:44 +0000
+++ win32/MDIChildFrame.h 2012-10-16 16:17:56 +0000
@@ -238,10 +238,10 @@
closing = true;
// async to make sure all other async calls have been consumed
this->callAsync([this] {
- t().postClosing();
- if(getParent()->getActive() == this) {
+ this->t().postClosing();
+ if(this->getParent()->getActive() == this) {
// Prevent flicker by selecting the next tab - WM_DESTROY would already be too late
- getParent()->next();
+ this->getParent()->next();
}
::DestroyWindow(handle());
});