Change BObjectList to take "owning" as a template parameter and adjust all consumers.
Since BObjectList is a template class, this only breaks ABI where BObjectList was exposed in public methods, and even then it's only a name mangling break and we should be able to add compatibility methods if necessary. (The old "bool owning" member variable is left intact for ABI compatibility, for the moment, though it's otherwise unused now.) Tracker's PoseList is the only remaining type that has a "bool owning" switch in the constructor rather than template parameters. This should significantly improve the output of static code analysis tools that previously detected list operations as causing use-after-frees and double-frees, as well as make code maintenance easier by making it easier to determine what list owns (or does not own) an object. It should also be a minor performance optimization, since the branches for calls to delete/free should now be optimized out altogether. Still boots to desktop and Tracker, Deskbar, Debugger all tested and verified as working. Change-Id: If2a24a6f0d22e7a506ef554fcfdd328907279ed4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8915 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
007126ed6f
commit
cbfbbf6d4d
@@ -150,7 +150,7 @@ public:
|
||||
const BCommitTransactionResult& other);
|
||||
|
||||
private:
|
||||
typedef BObjectList<BTransactionIssue> IssueList;
|
||||
typedef BObjectList<BTransactionIssue, true> IssueList;
|
||||
|
||||
private:
|
||||
BTransactionError fError;
|
||||
|
||||
@@ -87,25 +87,25 @@ public:
|
||||
const BStringList& URLList() const;
|
||||
const BStringList& SourceURLList() const;
|
||||
|
||||
const BObjectList<BGlobalWritableFileInfo>&
|
||||
const BObjectList<BGlobalWritableFileInfo, true>&
|
||||
GlobalWritableFileInfos() const;
|
||||
const BObjectList<BUserSettingsFileInfo>&
|
||||
const BObjectList<BUserSettingsFileInfo, true>&
|
||||
UserSettingsFileInfos() const;
|
||||
|
||||
const BObjectList<BUser>& Users() const;
|
||||
const BObjectList<BUser, true>& Users() const;
|
||||
const BStringList& Groups() const;
|
||||
|
||||
const BStringList& PostInstallScripts() const;
|
||||
const BStringList& PreUninstallScripts() const;
|
||||
|
||||
const BObjectList<BPackageResolvable>& ProvidesList() const;
|
||||
const BObjectList<BPackageResolvableExpression>&
|
||||
const BObjectList<BPackageResolvable, true>& ProvidesList() const;
|
||||
const BObjectList<BPackageResolvableExpression, true>&
|
||||
RequiresList() const;
|
||||
const BObjectList<BPackageResolvableExpression>&
|
||||
const BObjectList<BPackageResolvableExpression, true>&
|
||||
SupplementsList() const;
|
||||
const BObjectList<BPackageResolvableExpression>&
|
||||
const BObjectList<BPackageResolvableExpression, true>&
|
||||
ConflictsList() const;
|
||||
const BObjectList<BPackageResolvableExpression>&
|
||||
const BObjectList<BPackageResolvableExpression, true>&
|
||||
FreshensList() const;
|
||||
const BStringList& ReplacesList() const;
|
||||
|
||||
@@ -223,16 +223,16 @@ private:
|
||||
struct FieldName;
|
||||
struct PackageFileLocation;
|
||||
|
||||
typedef BObjectList<BPackageResolvable> ResolvableList;
|
||||
typedef BObjectList<BPackageResolvableExpression>
|
||||
typedef BObjectList<BPackageResolvable, true> ResolvableList;
|
||||
typedef BObjectList<BPackageResolvableExpression, true>
|
||||
ResolvableExpressionList;
|
||||
|
||||
typedef BObjectList<BGlobalWritableFileInfo>
|
||||
typedef BObjectList<BGlobalWritableFileInfo, true>
|
||||
GlobalWritableFileInfoList;
|
||||
typedef BObjectList<BUserSettingsFileInfo>
|
||||
typedef BObjectList<BUserSettingsFileInfo, true>
|
||||
UserSettingsFileInfoList;
|
||||
|
||||
typedef BObjectList<BUser> UserList;
|
||||
typedef BObjectList<BUser, true> UserList;
|
||||
|
||||
private:
|
||||
status_t _ReadFromPackageFile(
|
||||
@@ -298,8 +298,8 @@ private:
|
||||
BStringList fURLList;
|
||||
BStringList fSourceURLList;
|
||||
|
||||
BObjectList<BGlobalWritableFileInfo> fGlobalWritableFileInfos;
|
||||
BObjectList<BUserSettingsFileInfo> fUserSettingsFileInfos;
|
||||
GlobalWritableFileInfoList fGlobalWritableFileInfos;
|
||||
UserSettingsFileInfoList fUserSettingsFileInfos;
|
||||
|
||||
UserList fUsers;
|
||||
BStringList fGroups;
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
BString ToString() const;
|
||||
|
||||
private:
|
||||
typedef BObjectList<BSolverProblemSolution> SolutionList;
|
||||
typedef BObjectList<BSolverProblemSolution, true> SolutionList;
|
||||
|
||||
private:
|
||||
BType fType;
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
bool AppendElement(const Element& element);
|
||||
|
||||
private:
|
||||
typedef BObjectList<Element> ElementList;
|
||||
typedef BObjectList<Element, true> ElementList;
|
||||
|
||||
private:
|
||||
ElementList fElements;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
uint64 ChangeCount() const;
|
||||
|
||||
private:
|
||||
typedef BObjectList<BSolverPackage> PackageList;
|
||||
typedef BObjectList<BSolverPackage, true> PackageList;
|
||||
|
||||
private:
|
||||
BString fName;
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
const BSolverResultElement& element);
|
||||
|
||||
private:
|
||||
typedef BObjectList<BSolverResultElement> ElementList;
|
||||
typedef BObjectList<BSolverResultElement, true> ElementList;
|
||||
|
||||
private:
|
||||
ElementList fElements;
|
||||
|
||||
Reference in New Issue
Block a user