Reduce padding in class

TorrentHandleImpl size is reduced from 768 bytes to 736 bytes.
CreateTorrentParams size didn't change.
Size numbers are from x64.
This commit is contained in:
Chocobo1
2020-04-19 11:14:37 +08:00
parent ac2d063add
commit 1b80890696
2 changed files with 16 additions and 15 deletions

View File

@@ -55,12 +55,16 @@ namespace BitTorrent
struct CreateTorrentParams
{
bool restored = false; // is existing torrent job?
CreateTorrentParams() = default;
explicit CreateTorrentParams(const AddTorrentParams &params);
// for both new and restored torrents
QString name;
QString category;
QSet<QString> tags;
QString savePath;
int uploadLimit = -1;
int downloadLimit = -1;
bool disableTempPath = false;
bool sequential = false;
bool firstLastPiecePriority = false;
@@ -69,17 +73,15 @@ namespace BitTorrent
bool hasRootFolder = true;
bool forced = false;
bool paused = false;
int uploadLimit = -1;
int downloadLimit = -1;
bool restored = false; // is existing torrent job?
// for new torrents
QVector<DownloadPriority> filePriorities;
QDateTime addedTime;
// for restored torrents
qreal ratioLimit = TorrentHandle::USE_GLOBAL_RATIO;
int seedingTimeLimit = TorrentHandle::USE_GLOBAL_SEEDING_TIME;
CreateTorrentParams() = default;
explicit CreateTorrentParams(const AddTorrentParams &params);
};
enum class MoveStorageMode
@@ -304,33 +306,32 @@ namespace BitTorrent
InfoHash m_hash;
bool m_storageIsMoving = false;
// m_moveFinishedTriggers is activated only when the following conditions are met:
// all file rename jobs complete, all file move jobs complete
QQueue<EventTrigger> m_moveFinishedTriggers;
int m_renameCount = 0;
bool m_storageIsMoving = false;
// Until libtorrent provide an "old_name" field in `file_renamed_alert`
// we will rely on this workaround to remove empty leftover folders
QHash<LTFileIndex, QVector<QString>> m_oldPath;
bool m_useAutoTMM;
QHash<QString, TrackerInfo> m_trackerInfos;
// Persistent data
QString m_name;
QString m_savePath;
QString m_category;
QSet<QString> m_tags;
bool m_hasSeedStatus;
qreal m_ratioLimit;
int m_seedingTimeLimit;
bool m_hasSeedStatus;
bool m_tempPathDisabled;
bool m_fastresumeDataRejected = false;
bool m_hasMissingFiles = false;
bool m_hasRootFolder;
bool m_needsToSetFirstLastPiecePriority = false;
QHash<QString, TrackerInfo> m_trackerInfos;
bool m_useAutoTMM;
bool m_unchecked = false;
};