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:
Augustin Cavalier
2025-02-06 00:06:32 +00:00
committed by waddlesplash
parent 007126ed6f
commit cbfbbf6d4d
247 changed files with 761 additions and 705 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ private:
Variable* fVar; Variable* fVar;
}; };
typedef BObjectList<Summand> SummandList; typedef BObjectList<Summand, true> SummandList;
} // namespace LinearProgramming } // namespace LinearProgramming
+1 -1
View File
@@ -119,7 +119,7 @@ public:
virtual bool HasBeenModified() const; virtual bool HasBeenModified() const;
private: private:
BObjectList<BMailAddOnSettings> fFiltersSettings; BObjectList<BMailAddOnSettings, true> fFiltersSettings;
}; };
+1 -1
View File
@@ -108,7 +108,7 @@ public:
const BNetworkRoute& route); const BNetworkRoute& route);
status_t RemoveDefaultRoute(int family); status_t RemoveDefaultRoute(int family);
status_t GetRoutes(int family, status_t GetRoutes(int family,
BObjectList<BNetworkRoute>& routes) const; BObjectList<BNetworkRoute, true>& routes) const;
status_t GetDefaultRoute(int family, status_t GetDefaultRoute(int family,
BNetworkRoute& route) const; BNetworkRoute& route) const;
status_t GetDefaultGateway(int family, status_t GetDefaultGateway(int family,
+3 -3
View File
@@ -54,12 +54,12 @@ static status_t GetDefaultGateway(int family,
sockaddr& gateway); sockaddr& gateway);
static status_t GetRoutes(int family, static status_t GetRoutes(int family,
BObjectList<BNetworkRoute>& routes); BObjectList<BNetworkRoute, true>& routes);
static status_t GetRoutes(int family, const char* interfaceName, static status_t GetRoutes(int family, const char* interfaceName,
BObjectList<BNetworkRoute>& routes); BObjectList<BNetworkRoute, true>& routes);
static status_t GetRoutes(int family, const char* interfaceName, static status_t GetRoutes(int family, const char* interfaceName,
uint32 filterFlags, uint32 filterFlags,
BObjectList<BNetworkRoute>& routes); BObjectList<BNetworkRoute, true>& routes);
private: private:
BNetworkRoute(const BNetworkRoute& other); BNetworkRoute(const BNetworkRoute& other);
+1 -1
View File
@@ -150,7 +150,7 @@ public:
const BCommitTransactionResult& other); const BCommitTransactionResult& other);
private: private:
typedef BObjectList<BTransactionIssue> IssueList; typedef BObjectList<BTransactionIssue, true> IssueList;
private: private:
BTransactionError fError; BTransactionError fError;
+15 -15
View File
@@ -87,25 +87,25 @@ public:
const BStringList& URLList() const; const BStringList& URLList() const;
const BStringList& SourceURLList() const; const BStringList& SourceURLList() const;
const BObjectList<BGlobalWritableFileInfo>& const BObjectList<BGlobalWritableFileInfo, true>&
GlobalWritableFileInfos() const; GlobalWritableFileInfos() const;
const BObjectList<BUserSettingsFileInfo>& const BObjectList<BUserSettingsFileInfo, true>&
UserSettingsFileInfos() const; UserSettingsFileInfos() const;
const BObjectList<BUser>& Users() const; const BObjectList<BUser, true>& Users() const;
const BStringList& Groups() const; const BStringList& Groups() const;
const BStringList& PostInstallScripts() const; const BStringList& PostInstallScripts() const;
const BStringList& PreUninstallScripts() const; const BStringList& PreUninstallScripts() const;
const BObjectList<BPackageResolvable>& ProvidesList() const; const BObjectList<BPackageResolvable, true>& ProvidesList() const;
const BObjectList<BPackageResolvableExpression>& const BObjectList<BPackageResolvableExpression, true>&
RequiresList() const; RequiresList() const;
const BObjectList<BPackageResolvableExpression>& const BObjectList<BPackageResolvableExpression, true>&
SupplementsList() const; SupplementsList() const;
const BObjectList<BPackageResolvableExpression>& const BObjectList<BPackageResolvableExpression, true>&
ConflictsList() const; ConflictsList() const;
const BObjectList<BPackageResolvableExpression>& const BObjectList<BPackageResolvableExpression, true>&
FreshensList() const; FreshensList() const;
const BStringList& ReplacesList() const; const BStringList& ReplacesList() const;
@@ -223,16 +223,16 @@ private:
struct FieldName; struct FieldName;
struct PackageFileLocation; struct PackageFileLocation;
typedef BObjectList<BPackageResolvable> ResolvableList; typedef BObjectList<BPackageResolvable, true> ResolvableList;
typedef BObjectList<BPackageResolvableExpression> typedef BObjectList<BPackageResolvableExpression, true>
ResolvableExpressionList; ResolvableExpressionList;
typedef BObjectList<BGlobalWritableFileInfo> typedef BObjectList<BGlobalWritableFileInfo, true>
GlobalWritableFileInfoList; GlobalWritableFileInfoList;
typedef BObjectList<BUserSettingsFileInfo> typedef BObjectList<BUserSettingsFileInfo, true>
UserSettingsFileInfoList; UserSettingsFileInfoList;
typedef BObjectList<BUser> UserList; typedef BObjectList<BUser, true> UserList;
private: private:
status_t _ReadFromPackageFile( status_t _ReadFromPackageFile(
@@ -298,8 +298,8 @@ private:
BStringList fURLList; BStringList fURLList;
BStringList fSourceURLList; BStringList fSourceURLList;
BObjectList<BGlobalWritableFileInfo> fGlobalWritableFileInfos; GlobalWritableFileInfoList fGlobalWritableFileInfos;
BObjectList<BUserSettingsFileInfo> fUserSettingsFileInfos; UserSettingsFileInfoList fUserSettingsFileInfos;
UserList fUsers; UserList fUsers;
BStringList fGroups; BStringList fGroups;
+1 -1
View File
@@ -64,7 +64,7 @@ public:
BString ToString() const; BString ToString() const;
private: private:
typedef BObjectList<BSolverProblemSolution> SolutionList; typedef BObjectList<BSolverProblemSolution, true> SolutionList;
private: private:
BType fType; BType fType;
@@ -77,7 +77,7 @@ public:
bool AppendElement(const Element& element); bool AppendElement(const Element& element);
private: private:
typedef BObjectList<Element> ElementList; typedef BObjectList<Element, true> ElementList;
private: private:
ElementList fElements; ElementList fElements;
+1 -1
View File
@@ -71,7 +71,7 @@ public:
uint64 ChangeCount() const; uint64 ChangeCount() const;
private: private:
typedef BObjectList<BSolverPackage> PackageList; typedef BObjectList<BSolverPackage, true> PackageList;
private: private:
BString fName; BString fName;
+1 -1
View File
@@ -54,7 +54,7 @@ public:
const BSolverResultElement& element); const BSolverResultElement& element);
private: private:
typedef BObjectList<BSolverResultElement> ElementList; typedef BObjectList<BSolverResultElement, true> ElementList;
private: private:
ElementList fElements; ElementList fElements;
+116 -124
View File
@@ -46,7 +46,7 @@ All rights reserved.
// optional object ownership, search, insert operations, etc. // optional object ownership, search, insert operations, etc.
// //
template<class T> class BObjectList; template<class T, bool Owning = false> class BObjectList;
template<class T> template<class T>
@@ -61,7 +61,8 @@ struct UnaryPredicate {
private: private:
static int _unary_predicate_glue(const void *item, void *context); static int _unary_predicate_glue(const void *item, void *context);
friend class BObjectList<T>; friend class BObjectList<T, false>;
friend class BObjectList<T, true>;
}; };
@@ -100,17 +101,16 @@ public:
void *state) const; void *state) const;
int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const;
bool Owning() const;
bool ReplaceItem(int32, void *); bool ReplaceItem(int32, void *);
bool MoveItem(int32 from, int32 to); bool MoveItem(int32 from, int32 to);
protected: private:
bool owning; bool fLegacyOwning;
// here only for API/ABI compatibility
}; };
template<class T> template<class T, bool Owning>
class BObjectList : private _PointerList_ { class BObjectList : private _PointerList_ {
public: public:
// iteration and sorting // iteration and sorting
@@ -120,8 +120,7 @@ public:
typedef int (*CompareFunctionWithState)(const T*, const T*, typedef int (*CompareFunctionWithState)(const T*, const T*,
void* state); void* state);
BObjectList(int32 itemsPerBlock = 20, BObjectList(int32 itemsPerBlock = 20);
bool owning = false);
BObjectList(const BObjectList& list); BObjectList(const BObjectList& list);
// clones list; if list is owning, makes // clones list; if list is owning, makes
// copies of all the items // copies of all the items
@@ -408,28 +407,20 @@ EachListItem(BObjectList<Item>* list,
// inline code // inline code
inline bool template<class T, bool Owning>
_PointerList_::Owning() const BObjectList<T, Owning>::BObjectList(int32 itemsPerBlock)
{
return owning;
}
template<class T>
BObjectList<T>::BObjectList(int32 itemsPerBlock, bool owning)
: :
_PointerList_(itemsPerBlock, owning) _PointerList_(itemsPerBlock, Owning)
{ {
} }
template<class T> template<class T, bool O>
BObjectList<T>::BObjectList(const BObjectList<T>& list) BObjectList<T, O>::BObjectList(const BObjectList<T, O>& list)
: :
_PointerList_(list) _PointerList_(list)
{ {
owning = list.owning; if (O) {
if (owning) {
// make our own copies in an owning list // make our own copies in an owning list
int32 count = list.CountItems(); int32 count = list.CountItems();
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
@@ -442,23 +433,22 @@ BObjectList<T>::BObjectList(const BObjectList<T>& list)
} }
template<class T> template<class T, bool Owning>
BObjectList<T>::~BObjectList() BObjectList<T, Owning>::~BObjectList()
{ {
if (Owning()) { if (Owning) {
// have to nuke elements first // have to nuke elements first
MakeEmpty(); MakeEmpty();
} }
} }
template<class T> template<class T, bool Owning>
BObjectList<T>& BObjectList<T, Owning>&
BObjectList<T>::operator=(const BObjectList<T>& list) BObjectList<T, Owning>::operator=(const BObjectList<T, Owning>& list)
{ {
owning = list.owning; BObjectList<T, Owning> &result = (BObjectList<T, Owning>&)_PointerList_::operator=(list);
BObjectList<T> &result = (BObjectList<T>&)_PointerList_::operator=(list); if (Owning) {
if (owning) {
// make our own copies in an owning list // make our own copies in an owning list
int32 count = list.CountItems(); int32 count = list.CountItems();
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
@@ -472,82 +462,82 @@ BObjectList<T>::operator=(const BObjectList<T>& list)
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::AddItem(T* item) BObjectList<T, O>::AddItem(T* item)
{ {
// need to cast to void* to make T work for const pointers // need to cast to void* to make T work for const pointers
return _PointerList_::AddItem((void*)item); return _PointerList_::AddItem((void*)item);
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::AddItem(T* item, int32 index) BObjectList<T, O>::AddItem(T* item, int32 index)
{ {
return _PointerList_::AddItem((void*)item, index); return _PointerList_::AddItem((void*)item, index);
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::AddList(BObjectList<T>* list) BObjectList<T, O>::AddList(BObjectList<T, O>* list)
{ {
return _PointerList_::AddList(list); return _PointerList_::AddList(list);
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::AddList(BObjectList<T>* list, int32 index) BObjectList<T, O>::AddList(BObjectList<T, O>* list, int32 index)
{ {
return _PointerList_::AddList(list, index); return _PointerList_::AddList(list, index);
} }
template<class T> template<class T, bool Owning>
bool bool
BObjectList<T>::RemoveItem(T* item, bool deleteIfOwning) BObjectList<T, Owning>::RemoveItem(T* item, bool deleteIfOwning)
{ {
bool result = _PointerList_::RemoveItem((void*)item); bool result = _PointerList_::RemoveItem((void*)item);
if (result && Owning() && deleteIfOwning) if (result && Owning && deleteIfOwning)
delete item; delete item;
return result; return result;
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::RemoveItemAt(int32 index) BObjectList<T, O>::RemoveItemAt(int32 index)
{ {
return (T*)_PointerList_::RemoveItem(index); return (T*)_PointerList_::RemoveItem(index);
} }
template<class T> template<class T, bool O>
inline T* inline T*
BObjectList<T>::ItemAt(int32 index) const BObjectList<T, O>::ItemAt(int32 index) const
{ {
return (T*)_PointerList_::ItemAt(index); return (T*)_PointerList_::ItemAt(index);
} }
template<class T> template<class T, bool Owning>
bool bool
BObjectList<T>::ReplaceItem(int32 index, T* item) BObjectList<T, Owning>::ReplaceItem(int32 index, T* item)
{ {
if (owning) if (Owning)
delete ItemAt(index); delete ItemAt(index);
return _PointerList_::ReplaceItem(index, (void*)item); return _PointerList_::ReplaceItem(index, (void*)item);
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::SwapWithItem(int32 index, T* item) BObjectList<T, O>::SwapWithItem(int32 index, T* item)
{ {
T* result = ItemAt(index); T* result = ItemAt(index);
_PointerList_::ReplaceItem(index, (void*)item); _PointerList_::ReplaceItem(index, (void*)item);
@@ -556,75 +546,75 @@ BObjectList<T>::SwapWithItem(int32 index, T* item)
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::MoveItem(int32 from, int32 to) BObjectList<T, O>::MoveItem(int32 from, int32 to)
{ {
return _PointerList_::MoveItem(from, to); return _PointerList_::MoveItem(from, to);
} }
template<class T> template<class T, bool O>
void void
BObjectList<T>::_SetItem(int32 index, T* newItem) BObjectList<T, O>::_SetItem(int32 index, T* newItem)
{ {
_PointerList_::ReplaceItem(index, (void*)newItem); _PointerList_::ReplaceItem(index, (void*)newItem);
} }
template<class T> template<class T, bool O>
int32 int32
BObjectList<T>::IndexOf(const T* item) const BObjectList<T, O>::IndexOf(const T* item) const
{ {
return _PointerList_::IndexOf((void*)item); return _PointerList_::IndexOf((void*)item);
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::FirstItem() const BObjectList<T, O>::FirstItem() const
{ {
return (T*)_PointerList_::FirstItem(); return (T*)_PointerList_::FirstItem();
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::LastItem() const BObjectList<T, O>::LastItem() const
{ {
return (T*)_PointerList_::LastItem(); return (T*)_PointerList_::LastItem();
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::HasItem(const T* item) const BObjectList<T, O>::HasItem(const T* item) const
{ {
return _PointerList_::HasItem((void*)item); return _PointerList_::HasItem((void*)item);
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::IsEmpty() const BObjectList<T, O>::IsEmpty() const
{ {
return _PointerList_::IsEmpty(); return _PointerList_::IsEmpty();
} }
template<class T> template<class T, bool O>
int32 int32
BObjectList<T>::CountItems() const BObjectList<T, O>::CountItems() const
{ {
return _PointerList_::CountItems(); return _PointerList_::CountItems();
} }
template<class T> template<class T, bool Owning>
void void
BObjectList<T>::MakeEmpty(bool deleteIfOwning) BObjectList<T, Owning>::MakeEmpty(bool deleteIfOwning)
{ {
if (owning && deleteIfOwning) { if (Owning && deleteIfOwning) {
int32 count = CountItems(); int32 count = CountItems();
for (int32 index = 0; index < count; index++) for (int32 index = 0; index < count; index++)
delete ItemAt(index); delete ItemAt(index);
@@ -633,26 +623,27 @@ BObjectList<T>::MakeEmpty(bool deleteIfOwning)
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::EachElement(EachFunction func, void* params) BObjectList<T, O>::EachElement(EachFunction func, void* params)
{ {
return (T*)_PointerList_::EachElement((GenericEachFunction)func, params); return (T*)_PointerList_::EachElement((GenericEachFunction)func, params);
} }
template<class T> template<class T, bool O>
const T* const T*
BObjectList<T>::EachElement(ConstEachFunction func, void* params) const BObjectList<T, O>::EachElement(ConstEachFunction func, void* params) const
{ {
return (const T*) return (const T*)
const_cast<BObjectList<T>*>(this)->_PointerList_::EachElement( const_cast<BObjectList<T, O>*>(this)->_PointerList_::EachElement(
(GenericEachFunction)func, params); (GenericEachFunction)func, params);
} }
template<class T>
template<class T, bool O>
const T* const T*
BObjectList<T>::FindIf(const UnaryPredicate<T>& predicate) const BObjectList<T, O>::FindIf(const UnaryPredicate<T>& predicate) const
{ {
int32 count = CountItems(); int32 count = CountItems();
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
@@ -662,9 +653,10 @@ BObjectList<T>::FindIf(const UnaryPredicate<T>& predicate) const
return 0; return 0;
} }
template<class T>
template<class T, bool O>
T* T*
BObjectList<T>::FindIf(const UnaryPredicate<T>& predicate) BObjectList<T, O>::FindIf(const UnaryPredicate<T>& predicate)
{ {
int32 count = CountItems(); int32 count = CountItems();
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
@@ -675,49 +667,49 @@ BObjectList<T>::FindIf(const UnaryPredicate<T>& predicate)
} }
template<class T> template<class T, bool O>
void void
BObjectList<T>::SortItems(CompareFunction function) BObjectList<T, O>::SortItems(CompareFunction function)
{ {
_PointerList_::SortItems((GenericCompareFunction)function); _PointerList_::SortItems((GenericCompareFunction)function);
} }
template<class T> template<class T, bool O>
void void
BObjectList<T>::SortItems(CompareFunctionWithState function, void* state) BObjectList<T, O>::SortItems(CompareFunctionWithState function, void* state)
{ {
_PointerList_::SortItems((GenericCompareFunctionWithState)function, state); _PointerList_::SortItems((GenericCompareFunctionWithState)function, state);
} }
template<class T> template<class T, bool O>
void void
BObjectList<T>::HSortItems(CompareFunction function) BObjectList<T, O>::HSortItems(CompareFunction function)
{ {
_PointerList_::HSortItems((GenericCompareFunction)function); _PointerList_::HSortItems((GenericCompareFunction)function);
} }
template<class T> template<class T, bool O>
void void
BObjectList<T>::HSortItems(CompareFunctionWithState function, void* state) BObjectList<T, O>::HSortItems(CompareFunctionWithState function, void* state)
{ {
_PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state);
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinarySearch(const T& key, CompareFunction func) const BObjectList<T, O>::BinarySearch(const T& key, CompareFunction func) const
{ {
return (T*)_PointerList_::BinarySearch(&key, (GenericCompareFunction)func); return (T*)_PointerList_::BinarySearch(&key, (GenericCompareFunction)func);
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinarySearch(const T& key, CompareFunctionWithState func, BObjectList<T, O>::BinarySearch(const T& key, CompareFunctionWithState func,
void* state) const void* state) const
{ {
return (T*)_PointerList_::BinarySearch(&key, return (T*)_PointerList_::BinarySearch(&key,
@@ -725,10 +717,10 @@ BObjectList<T>::BinarySearch(const T& key, CompareFunctionWithState func,
} }
template<class T> template<class T, bool O>
template<typename Key> template<typename Key>
T* T*
BObjectList<T>::BinarySearchByKey(const Key& key, BObjectList<T, O>::BinarySearchByKey(const Key& key,
int (*compare)(const Key*, const T*)) const int (*compare)(const Key*, const T*)) const
{ {
return (T*)_PointerList_::BinarySearch(&key, return (T*)_PointerList_::BinarySearch(&key,
@@ -736,10 +728,10 @@ BObjectList<T>::BinarySearchByKey(const Key& key,
} }
template<class T> template<class T, bool O>
template<typename Key> template<typename Key>
T* T*
BObjectList<T>::BinarySearchByKey(const Key &key, BObjectList<T, O>::BinarySearchByKey(const Key &key,
int (*compare)(const Key*, const T*, void*), void* state) const int (*compare)(const Key*, const T*, void*), void* state) const
{ {
return (T*)_PointerList_::BinarySearch(&key, return (T*)_PointerList_::BinarySearch(&key,
@@ -747,18 +739,18 @@ BObjectList<T>::BinarySearchByKey(const Key &key,
} }
template<class T> template<class T, bool O>
int32 int32
BObjectList<T>::BinarySearchIndex(const T& item, CompareFunction compare) const BObjectList<T, O>::BinarySearchIndex(const T& item, CompareFunction compare) const
{ {
return _PointerList_::BinarySearchIndex(&item, return _PointerList_::BinarySearchIndex(&item,
(GenericCompareFunction)compare); (GenericCompareFunction)compare);
} }
template<class T> template<class T, bool O>
int32 int32
BObjectList<T>::BinarySearchIndex(const T& item, BObjectList<T, O>::BinarySearchIndex(const T& item,
CompareFunctionWithState compare, void* state) const CompareFunctionWithState compare, void* state) const
{ {
return _PointerList_::BinarySearchIndex(&item, return _PointerList_::BinarySearchIndex(&item,
@@ -766,10 +758,10 @@ BObjectList<T>::BinarySearchIndex(const T& item,
} }
template<class T> template<class T, bool O>
template<typename Key> template<typename Key>
int32 int32
BObjectList<T>::BinarySearchIndexByKey(const Key& key, BObjectList<T, O>::BinarySearchIndexByKey(const Key& key,
int (*compare)(const Key*, const T*)) const int (*compare)(const Key*, const T*)) const
{ {
return _PointerList_::BinarySearchIndex(&key, return _PointerList_::BinarySearchIndex(&key,
@@ -777,9 +769,9 @@ BObjectList<T>::BinarySearchIndexByKey(const Key& key,
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsert(T* item, CompareFunction func) BObjectList<T, O>::BinaryInsert(T* item, CompareFunction func)
{ {
int32 index = _PointerList_::BinarySearchIndex(item, int32 index = _PointerList_::BinarySearchIndex(item,
(GenericCompareFunction)func); (GenericCompareFunction)func);
@@ -792,9 +784,9 @@ BObjectList<T>::BinaryInsert(T* item, CompareFunction func)
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsert(T* item, CompareFunctionWithState func, BObjectList<T, O>::BinaryInsert(T* item, CompareFunctionWithState func,
void* state) void* state)
{ {
int32 index = _PointerList_::BinarySearchIndex(item, int32 index = _PointerList_::BinarySearchIndex(item,
@@ -808,9 +800,9 @@ BObjectList<T>::BinaryInsert(T* item, CompareFunctionWithState func,
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsertUnique(T* item, CompareFunction func) BObjectList<T, O>::BinaryInsertUnique(T* item, CompareFunction func)
{ {
int32 index = _PointerList_::BinarySearchIndex(item, int32 index = _PointerList_::BinarySearchIndex(item,
(GenericCompareFunction)func); (GenericCompareFunction)func);
@@ -821,9 +813,9 @@ BObjectList<T>::BinaryInsertUnique(T* item, CompareFunction func)
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsertUnique(T* item, CompareFunctionWithState func, BObjectList<T, O>::BinaryInsertUnique(T* item, CompareFunctionWithState func,
void* state) void* state)
{ {
int32 index = _PointerList_::BinarySearchIndex(item, int32 index = _PointerList_::BinarySearchIndex(item,
@@ -835,9 +827,9 @@ BObjectList<T>::BinaryInsertUnique(T* item, CompareFunctionWithState func,
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinaryInsertCopy(const T& copyThis, CompareFunction func) BObjectList<T, O>::BinaryInsertCopy(const T& copyThis, CompareFunction func)
{ {
int32 index = _PointerList_::BinarySearchIndex(&copyThis, int32 index = _PointerList_::BinarySearchIndex(&copyThis,
(GenericCompareFunction)func); (GenericCompareFunction)func);
@@ -853,9 +845,9 @@ BObjectList<T>::BinaryInsertCopy(const T& copyThis, CompareFunction func)
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinaryInsertCopy(const T& copyThis, BObjectList<T, O>::BinaryInsertCopy(const T& copyThis,
CompareFunctionWithState func, void* state) CompareFunctionWithState func, void* state)
{ {
int32 index = _PointerList_::BinarySearchIndex(&copyThis, int32 index = _PointerList_::BinarySearchIndex(&copyThis,
@@ -872,9 +864,9 @@ BObjectList<T>::BinaryInsertCopy(const T& copyThis,
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis, CompareFunction func) BObjectList<T, O>::BinaryInsertCopyUnique(const T& copyThis, CompareFunction func)
{ {
int32 index = _PointerList_::BinarySearchIndex(&copyThis, int32 index = _PointerList_::BinarySearchIndex(&copyThis,
(GenericCompareFunction)func); (GenericCompareFunction)func);
@@ -888,9 +880,9 @@ BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis, CompareFunction func)
} }
template<class T> template<class T, bool O>
T* T*
BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis, BObjectList<T, O>::BinaryInsertCopyUnique(const T& copyThis,
CompareFunctionWithState func, void* state) CompareFunctionWithState func, void* state)
{ {
int32 index = _PointerList_::BinarySearchIndex(&copyThis, int32 index = _PointerList_::BinarySearchIndex(&copyThis,
@@ -905,9 +897,9 @@ BObjectList<T>::BinaryInsertCopyUnique(const T& copyThis,
} }
template<class T> template<class T, bool O>
int32 int32
BObjectList<T>::FindBinaryInsertionIndex(const UnaryPredicate<T>& pred, BObjectList<T, O>::FindBinaryInsertionIndex(const UnaryPredicate<T>& pred,
bool* alreadyInList) const bool* alreadyInList) const
{ {
int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred,
@@ -923,17 +915,17 @@ BObjectList<T>::FindBinaryInsertionIndex(const UnaryPredicate<T>& pred,
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsert(T* item, const UnaryPredicate<T>& pred) BObjectList<T, O>::BinaryInsert(T* item, const UnaryPredicate<T>& pred)
{ {
return AddItem(item, FindBinaryInsertionIndex(pred)); return AddItem(item, FindBinaryInsertionIndex(pred));
} }
template<class T> template<class T, bool O>
bool bool
BObjectList<T>::BinaryInsertUnique(T* item, const UnaryPredicate<T>& pred) BObjectList<T, O>::BinaryInsertUnique(T* item, const UnaryPredicate<T>& pred)
{ {
bool alreadyInList; bool alreadyInList;
int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); int32 index = FindBinaryInsertionIndex(pred, &alreadyInList);
@@ -42,7 +42,7 @@ public:
virtual ~SpecificImageDebugInfo(); virtual ~SpecificImageDebugInfo();
virtual status_t GetFunctions( virtual status_t GetFunctions(
const BObjectList<SymbolInfo>& symbols, const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions) BObjectList<FunctionDebugInfo>& functions)
= 0; = 0;
// returns references // returns references
@@ -93,7 +93,7 @@ public:
protected: protected:
static status_t GetFunctionsFromSymbols( static status_t GetFunctionsFromSymbols(
const BObjectList<SymbolInfo>& symbols, const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions, BObjectList<FunctionDebugInfo>& functions,
DebuggerInterface* interface, DebuggerInterface* interface,
const ImageInfo& imageInfo, const ImageInfo& imageInfo,
@@ -96,7 +96,7 @@ private:
struct SourceFileEntry; struct SourceFileEntry;
struct SourceFileHashDefinition; struct SourceFileHashDefinition;
typedef BObjectList<SpecificTeamDebugInfo> SpecificInfoList; typedef BObjectList<SpecificTeamDebugInfo, true> SpecificInfoList;
typedef BObjectList<ImageDebugInfo> ImageList; typedef BObjectList<ImageDebugInfo> ImageList;
typedef BOpenHashTable<FunctionHashDefinition> FunctionTable; typedef BOpenHashTable<FunctionHashDefinition> FunctionTable;
typedef BOpenHashTable<SourceFileHashDefinition> SourceFileTable; typedef BOpenHashTable<SourceFileHashDefinition> SourceFileTable;
+2 -2
View File
@@ -164,8 +164,8 @@ public:
private: private:
struct SymbolLookupSource; struct SymbolLookupSource;
typedef BObjectList<ElfSection> SectionList; typedef BObjectList<ElfSection, true> SectionList;
typedef BObjectList<ElfSegment> SegmentList; typedef BObjectList<ElfSegment, true> SegmentList;
private: private:
template<typename ElfClass> template<typename ElfClass>
@@ -52,7 +52,7 @@ public:
private: private:
struct Line; struct Line;
typedef BObjectList<Line> LineList; typedef BObjectList<Line, true> LineList;
typedef BObjectList<ContiguousStatement> StatementList; typedef BObjectList<ContiguousStatement> StatementList;
private: private:
@@ -138,7 +138,7 @@ public:
{ return !(*this == other); } { return !(*this == other); }
private: private:
typedef BObjectList<TypeComponent> ComponentList; typedef BObjectList<TypeComponent, true> ComponentList;
private: private:
ComponentList fComponents; ComponentList fComponents;
+1 -1
View File
@@ -30,7 +30,7 @@ struct Range {
}; };
class RangeList : private BObjectList<Range> class RangeList : private BObjectList<Range, true>
{ {
public: public:
RangeList(); RangeList();
+1 -1
View File
@@ -43,7 +43,7 @@ public:
uint32 which, uint32 flags, BIcon*& _icon); uint32 which, uint32 flags, BIcon*& _icon);
private: private:
typedef BObjectList<BBitmap> BitmapList; typedef BObjectList<BBitmap, true> BitmapList;
private: private:
static BBitmap* _ConvertToRGB32(const BBitmap* bitmap, static BBitmap* _ConvertToRGB32(const BBitmap* bitmap,
+1 -1
View File
@@ -89,7 +89,7 @@ public:
uint32 BytesPerRow(); uint32 BytesPerRow();
private: private:
friend class BObjectList<BPrivateScreen>; friend class BObjectList<BPrivateScreen, true>;
BPrivateScreen(int32 id); BPrivateScreen(int32 id);
~BPrivateScreen(); ~BPrivateScreen();
+1 -1
View File
@@ -46,7 +46,7 @@ private:
private: private:
BNetworkCookieJar fCookieJar; BNetworkCookieJar fCookieJar;
BHttpAuthenticationMap* fAuthenticationMap; BHttpAuthenticationMap* fAuthenticationMap;
typedef BObjectList<const BCertificate> BCertificateSet; typedef BObjectList<const BCertificate, true> BCertificateSet;
BCertificateSet fCertificates; BCertificateSet fCertificates;
BString fProxyHost; BString fProxyHost;
@@ -116,10 +116,8 @@ protected:
const BPackageVersion& version, const BPackageVersion& version,
BHPKGAttributeID attributeID BHPKGAttributeID attributeID
= kDefaultVersionAttributeID); = kDefaultVersionAttributeID);
void RegisterPackageResolvableExpressionList( void RegisterPackageResolvableExpressionList(PackageAttributeList& attributeList,
PackageAttributeList& attributeList, const BObjectList<BPackageResolvableExpression, true>& list,
const BObjectList<
BPackageResolvableExpression>& list,
uint8 id); uint8 id);
PackageAttribute* AddStringAttribute(BHPKGAttributeID id, PackageAttribute* AddStringAttribute(BHPKGAttributeID id,
@@ -53,10 +53,10 @@ public:
class ClientInstallationInterface; class ClientInstallationInterface;
class UserInteractionHandler; class UserInteractionHandler;
typedef BObjectList<RemoteRepository> RemoteRepositoryList; typedef BObjectList<RemoteRepository, true> RemoteRepositoryList;
typedef BObjectList<InstalledRepository> InstalledRepositoryList; typedef BObjectList<InstalledRepository> InstalledRepositoryList;
typedef BObjectList<BSolverPackage> PackageList; typedef BObjectList<BSolverPackage> PackageList;
typedef BObjectList<Transaction> TransactionList; typedef BObjectList<Transaction, true> TransactionList;
enum { enum {
B_ADD_INSTALLED_REPOSITORIES = 0x01, B_ADD_INSTALLED_REPOSITORIES = 0x01,
@@ -245,7 +245,7 @@ public:
void ApplyChanges(); void ApplyChanges();
private: private:
PackageList fDisabledPackages; BObjectList<BSolverPackage, true> fDisabledPackages;
PackageList fPackagesToActivate; PackageList fPackagesToActivate;
PackageList fPackagesToDeactivate; PackageList fPackagesToDeactivate;
const char* fInitialName; const char* fInitialName;
+2 -2
View File
@@ -44,8 +44,8 @@ public:
const void* pointer); const void* pointer);
private: private:
BObjectList<BMessage> fStack; BObjectList<BMessage> fStack;
BObjectList<BString> fNameStack; BObjectList<BString, true> fNameStack;
BMessage* fCurrentMessage; BMessage* fCurrentMessage;
}; };
+2 -2
View File
@@ -33,8 +33,8 @@ public:
private: private:
struct Column; struct Column;
typedef BObjectList<Column> ColumnList; typedef BObjectList<Column, true> ColumnList;
typedef BObjectList<BStringList> RowList; typedef BObjectList<BStringList, true> RowList;
private: private:
ColumnList fColumns; ColumnList fColumns;
+4 -4
View File
@@ -81,17 +81,17 @@ private:
class ThreadSequence : private SimpleThread { class ThreadSequence : private SimpleThread {
public: public:
static void Launch(BObjectList<FunctionObject>*, bool async = true, static void Launch(BObjectList<FunctionObject, true>*, bool async = true,
int32 priority = B_LOW_PRIORITY); int32 priority = B_LOW_PRIORITY);
private: private:
ThreadSequence(BObjectList<FunctionObject>*, int32 priority); ThreadSequence(BObjectList<FunctionObject, true>*, int32 priority);
~ThreadSequence(); ~ThreadSequence();
virtual void Run(); virtual void Run();
static void Run(BObjectList<FunctionObject>*list); static void Run(BObjectList<FunctionObject, true>* list);
BObjectList<FunctionObject>* fFunctorList; BObjectList<FunctionObject, true>* fFunctorList;
}; };
+1 -1
View File
@@ -85,7 +85,7 @@ private:
private: private:
BLocker *fLocker; BLocker *fLocker;
BObjectList<BDiskDevice> fDevices; BObjectList<BDiskDevice, true> fDevices;
bool fSubscribed; bool fSubscribed;
}; };
+1 -1
View File
@@ -55,7 +55,7 @@ protected:
// always invoked with index1 < index2 // always invoked with index1 < index2
private: private:
typedef BObjectList<BDirectory> DirectoryList; typedef BObjectList<BDirectory, true> DirectoryList;
struct EntryNameSet; struct EntryNameSet;
private: private:
+3 -3
View File
@@ -19,7 +19,7 @@ class BPartitionParameterEditor;
class BDiskDeviceVisitor; class BDiskDeviceVisitor;
class BDiskSystem; class BDiskSystem;
class BMutablePartition; class BMutablePartition;
template <class T> class BObjectList; template <class T, bool O> class BObjectList;
class BPartitioningInfo; class BPartitioningInfo;
class BPath; class BPath;
class BVolume; class BVolume;
@@ -106,9 +106,9 @@ public:
status_t ValidateResize(off_t* size) const; status_t ValidateResize(off_t* size) const;
status_t Resize(off_t size); status_t Resize(off_t size);
bool CanMove(BObjectList<BPartition>* bool CanMove(BObjectList<BPartition, false>*
unmovableDescendants = NULL, unmovableDescendants = NULL,
BObjectList<BPartition>* BObjectList<BPartition, false>*
movableOnlyIfUnmounted = NULL) const; movableOnlyIfUnmounted = NULL) const;
status_t ValidateMove(off_t* newOffset) const; status_t ValidateMove(off_t* newOffset) const;
status_t Move(off_t newOffset); status_t Move(off_t newOffset);
+3 -3
View File
@@ -9,10 +9,10 @@
#include <ObjectList.h> #include <ObjectList.h>
template<class T> template<class T, bool O>
class BObjectList<T>::Private { class BObjectList<T, O>::Private {
public: public:
Private(BObjectList<T>* objectList) Private(BObjectList<T, O>* objectList)
: :
fObjectList(objectList) fObjectList(objectList)
{ {
+2 -2
View File
@@ -46,7 +46,7 @@ All rights reserved.
#include "SlowMenu.h" #include "SlowMenu.h"
template<class T> class BObjectList; template<class T, bool O> class BObjectList;
class BMenuItem; class BMenuItem;
@@ -139,7 +139,7 @@ protected:
// menu building state // menu building state
uint8 fFlags; uint8 fFlags;
BObjectList<BMenuItem>* fItemList; BObjectList<BMenuItem, false>* fItemList;
EntryListBase* fContainer; EntryListBase* fContainer;
bool fIteratingDesktop; bool fIteratingDesktop;
@@ -611,7 +611,7 @@ KeyboardDevice::_EnqueueInlineInputMethod(int32 opcode,
KeyboardInputDevice::KeyboardInputDevice() KeyboardInputDevice::KeyboardInputDevice()
: :
fDevices(2, true), fDevices(2),
fDeviceListLock("KeyboardInputDevice list"), fDeviceListLock("KeyboardInputDevice list"),
fTeamMonitorWindow(NULL) fTeamMonitorWindow(NULL)
{ {
@@ -98,7 +98,7 @@ private:
status_t _AddDevice(const char* path); status_t _AddDevice(const char* path);
status_t _RemoveDevice(const char* path); status_t _RemoveDevice(const char* path);
BObjectList<KeyboardDevice> fDevices; BObjectList<KeyboardDevice, true> fDevices;
BLocker fDeviceListLock; BLocker fDeviceListLock;
TeamMonitorWindow* fTeamMonitorWindow; TeamMonitorWindow* fTeamMonitorWindow;
}; };
@@ -727,7 +727,7 @@ MouseDevice::_RemapButtons(uint32 buttons) const
MouseInputDevice::MouseInputDevice() MouseInputDevice::MouseInputDevice()
: :
fDevices(2, true), fDevices(2),
fDeviceListLock("MouseInputDevice list") fDeviceListLock("MouseInputDevice list")
{ {
MID_CALLED(); MID_CALLED();
@@ -44,7 +44,7 @@ private:
status_t _RemoveDevice(const char* path); status_t _RemoveDevice(const char* path);
private: private:
BObjectList<MouseDevice> fDevices; BObjectList<MouseDevice, true> fDevices;
BLocker fDeviceListLock; BLocker fDeviceListLock;
}; };
@@ -451,7 +451,7 @@ TabletDevice::_BuildMouseMessage(uint32 what, uint64 when, uint32 buttons,
TabletInputDevice::TabletInputDevice() TabletInputDevice::TabletInputDevice()
: :
fDevices(2, true), fDevices(2),
fDeviceListLock("TabletInputDevice list") fDeviceListLock("TabletInputDevice list")
{ {
TID_CALLED(); TID_CALLED();
@@ -45,7 +45,7 @@ private:
status_t _RemoveDevice(const char* path); status_t _RemoveDevice(const char* path);
private: private:
BObjectList<TabletDevice> fDevices; BObjectList<TabletDevice, true> fDevices;
BLocker fDeviceListLock; BLocker fDeviceListLock;
}; };
@@ -312,7 +312,7 @@ public:
CheckMailboxesCommand(IMAPConnectionWorker& worker) CheckMailboxesCommand(IMAPConnectionWorker& worker)
: :
fWorker(worker), fWorker(worker),
fFolders(5, false), fFolders(5),
fState(INIT), fState(INIT),
fFolder(NULL), fFolder(NULL),
fMailbox(NULL) fMailbox(NULL)
@@ -20,7 +20,7 @@ IMAPProtocol::IMAPProtocol(const BMailAccountSettings& settings)
: :
BInboundMailProtocol("IMAP", settings), BInboundMailProtocol("IMAP", settings),
fSettings(settings.Name(), settings.InboundSettings()), fSettings(settings.Name(), settings.InboundSettings()),
fWorkers(5, false) fWorkers(5)
{ {
BPath destination = fSettings.Destination(); BPath destination = fSettings.Destination();
@@ -27,7 +27,7 @@ Protocol::Protocol()
: :
fSocket(NULL), fSocket(NULL),
fBufferedSocket(NULL), fBufferedSocket(NULL),
fHandlerList(5, false), fHandlerList(5),
fCommandID(0), fCommandID(0),
fIsConnected(false) fIsConnected(false)
{ {
@@ -193,7 +193,7 @@ RFC3501Encoding::_Unshift(BString& buffer, int32& bitsToWrite, int32& sextet,
ArgumentList::ArgumentList() ArgumentList::ArgumentList()
: :
BObjectList<Argument>(5, true) BObjectList<Argument, true>(5)
{ {
} }
@@ -35,7 +35,7 @@ private:
}; };
class ArgumentList : public BObjectList<Argument> { class ArgumentList : public BObjectList<Argument, true> {
public: public:
ArgumentList(); ArgumentList();
~ArgumentList(); ~ArgumentList();
+5 -5
View File
@@ -98,10 +98,10 @@ struct HyperTextView::ActionInfo {
class HyperTextView::ActionInfoList class HyperTextView::ActionInfoList
: public BObjectList<HyperTextView::ActionInfo> { : public BObjectList<HyperTextView::ActionInfo, true> {
public: public:
ActionInfoList(int32 itemsPerBlock = 20, bool owning = false) ActionInfoList(int32 itemsPerBlock = 20)
: BObjectList<HyperTextView::ActionInfo>(itemsPerBlock, owning) : BObjectList<HyperTextView::ActionInfo, true>(itemsPerBlock)
{ {
} }
}; };
@@ -110,7 +110,7 @@ public:
HyperTextView::HyperTextView(const char* name, uint32 flags) HyperTextView::HyperTextView(const char* name, uint32 flags)
: :
BTextView(name, flags), BTextView(name, flags),
fActionInfos(new ActionInfoList(100, true)), fActionInfos(new ActionInfoList(100)),
fLastActionInfo(NULL) fLastActionInfo(NULL)
{ {
} }
@@ -120,7 +120,7 @@ HyperTextView::HyperTextView(BRect frame, const char* name, BRect textRect,
uint32 resizeMask, uint32 flags) uint32 resizeMask, uint32 flags)
: :
BTextView(frame, name, textRect, resizeMask, flags), BTextView(frame, name, textRect, resizeMask, flags),
fActionInfos(new ActionInfoList(100, true)), fActionInfos(new ActionInfoList(100)),
fLastActionInfo(NULL) fLastActionInfo(NULL)
{ {
} }
+1 -1
View File
@@ -24,7 +24,7 @@ BlockListItem::BlockListItem(const char* label, uint32 blockIndex)
UnicodeBlockView::UnicodeBlockView(const char* name) UnicodeBlockView::UnicodeBlockView(const char* name)
: BListView(name), : BListView(name),
fBlocks(kNumUnicodeBlocks, true), fBlocks(kNumUnicodeBlocks),
fShowPrivateBlocks(false), fShowPrivateBlocks(false),
fShowContainedBlocksOnly(false) fShowContainedBlocksOnly(false)
{ {
+1 -1
View File
@@ -50,7 +50,7 @@ private:
void _CreateBlocks(); void _CreateBlocks();
private: private:
BObjectList<BlockListItem> fBlocks; BObjectList<BlockListItem, true> fBlocks;
BString fFilter; BString fFilter;
bool fShowPrivateBlocks; bool fShowPrivateBlocks;
bool fShowContainedBlocksOnly; bool fShowContainedBlocksOnly;
@@ -109,7 +109,7 @@ AbstractTable::AbstractTable(const char* name, uint32 flags,
border_style borderStyle, bool showHorizontalScrollbar) border_style borderStyle, bool showHorizontalScrollbar)
: :
BColumnListView(name, flags, borderStyle, showHorizontalScrollbar), BColumnListView(name, flags, borderStyle, showHorizontalScrollbar),
fColumns(20, false) fColumns(20)
{ {
} }
@@ -458,7 +458,7 @@ public:
int32 IndexOf(TreeTableNode* child); int32 IndexOf(TreeTableNode* child);
private: private:
typedef BObjectList<TreeTableNode> NodeList; typedef BObjectList<TreeTableNode, true> NodeList;
private: private:
TreeTableNode* fParent; TreeTableNode* fParent;
@@ -532,7 +532,7 @@ bool
TreeTableNode::AddChild(TreeTableNode* child, int32 index) TreeTableNode::AddChild(TreeTableNode* child, int32 index)
{ {
if (fChildren == NULL) { if (fChildren == NULL) {
fChildren = new(std::nothrow) NodeList(10, true); fChildren = new(std::nothrow) NodeList(10);
if (fChildren == NULL) if (fChildren == NULL)
return false; return false;
} }
@@ -28,7 +28,7 @@ DebuggerSettingsManager::DebuggerSettingsManager()
: :
SettingsManager(), SettingsManager(),
fLock("settings manager"), fLock("settings manager"),
fRecentTeamSettings(kMaxRecentTeamSettings, true), fRecentTeamSettings(kMaxRecentTeamSettings),
fUiSettingsFactory(NULL) fUiSettingsFactory(NULL)
{ {
} }
@@ -29,7 +29,7 @@ public:
virtual status_t SaveTeamSettings(const TeamSettings& settings); virtual status_t SaveTeamSettings(const TeamSettings& settings);
private: private:
typedef BObjectList<TeamSettings> TeamSettingsList; typedef BObjectList<TeamSettings, true> TeamSettingsList;
private: private:
void _Unset(); void _Unset();
@@ -98,7 +98,7 @@ private:
CommandLineUserInterface::CommandLineUserInterface() CommandLineUserInterface::CommandLineUserInterface()
: :
fContext(new CliContext()), fContext(new CliContext()),
fCommands(20, true), fCommands(20),
fShowSemaphore(-1), fShowSemaphore(-1),
fShown(false), fShown(false),
fTerminating(false) fTerminating(false)
@@ -55,7 +55,7 @@ public:
private: private:
struct CommandEntry; struct CommandEntry;
typedef BObjectList<CommandEntry> CommandList; typedef BObjectList<CommandEntry, true> CommandList;
struct HelpCommand; struct HelpCommand;
@@ -131,7 +131,7 @@ GraphicalUserInterface::GraphicalUserInterface()
fTeamWindowMessenger(NULL), fTeamWindowMessenger(NULL),
fFilePanelHandler(NULL), fFilePanelHandler(NULL),
fFilePanel(NULL), fFilePanel(NULL),
fDefaultActions(10, true) fDefaultActions(10)
{ {
} }
@@ -62,7 +62,7 @@ private:
BString fKey; BString fKey;
int fDecision; int fDecision;
}; };
BObjectList<DefaultAction> fDefaultActions; BObjectList<DefaultAction, true> fDefaultActions;
}; };
@@ -17,7 +17,7 @@
ConnectionConfigHandlerRoster::ConnectionConfigHandlerRoster() ConnectionConfigHandlerRoster::ConnectionConfigHandlerRoster()
: :
fLock("config handler roster lock"), fLock("config handler roster lock"),
fConfigHandlers(10, true) fConfigHandlers(10)
{ {
} }
@@ -38,7 +38,7 @@ public:
ConnectionConfigView*& _view) const; ConnectionConfigView*& _view) const;
private: private:
typedef BObjectList<ConnectionConfigHandler> HandlerList; typedef BObjectList<ConnectionConfigHandler, true> HandlerList;
private: private:
bool _GetHandler(const BString& name, bool _GetHandler(const BString& name,
@@ -174,7 +174,7 @@ ConsoleOutputView::SaveSettings(BMessage& settings)
void void
ConsoleOutputView::_Init() ConsoleOutputView::_Init()
{ {
fPendingOutput = new OutputInfoList(10, true); fPendingOutput = new OutputInfoList(10);
fWorkToDoSem = create_sem(0, "output_work_available"); fWorkToDoSem = create_sem(0, "output_work_available");
if (fWorkToDoSem < 0) if (fWorkToDoSem < 0)
@@ -34,7 +34,7 @@ public:
private: private:
struct OutputInfo; struct OutputInfo;
typedef BObjectList<OutputInfo> OutputInfoList; typedef BObjectList<OutputInfo, true> OutputInfoList;
private: private:
void _Init(); void _Init();
@@ -154,7 +154,7 @@ public:
template<typename MarkerType> struct MarkerByLinePredicate; template<typename MarkerType> struct MarkerByLinePredicate;
typedef BObjectList<Marker> MarkerList; typedef BObjectList<Marker> MarkerList;
typedef BObjectList<BreakpointMarker> BreakpointMarkerList; typedef BObjectList<BreakpointMarker> BreakpointMarkerList;
void GetMarkers(uint32 minLine, uint32 maxLine, void GetMarkers(uint32 minLine, uint32 maxLine,
@@ -190,8 +190,8 @@ private:
SourceCode* fSourceCode; SourceCode* fSourceCode;
StackTrace* fStackTrace; StackTrace* fStackTrace;
StackFrame* fStackFrame; StackFrame* fStackFrame;
MarkerList fIPMarkers; BObjectList<Marker, true> fIPMarkers;
BreakpointMarkerList fBreakpointMarkers; BObjectList<BreakpointMarker, true> fBreakpointMarkers;
bool fIPMarkersValid; bool fIPMarkersValid;
bool fBreakpointMarkersValid; bool fBreakpointMarkersValid;
@@ -626,8 +626,8 @@ SourceView::MarkerManager::MarkerManager(SourceView* sourceView, Team* team,
fListener(listener), fListener(listener),
fStackTrace(NULL), fStackTrace(NULL),
fStackFrame(NULL), fStackFrame(NULL),
fIPMarkers(10, true), fIPMarkers(10),
fBreakpointMarkers(20, true), fBreakpointMarkers(20),
fIPMarkersValid(false), fIPMarkersValid(false),
fBreakpointMarkersValid(false) fBreakpointMarkersValid(false)
{ {
@@ -122,7 +122,7 @@ struct VariablesView::ExpressionInfoEntry : FunctionKey, ExpressionInfoList {
ExpressionInfoEntry(FunctionID* function) ExpressionInfoEntry(FunctionID* function)
: :
FunctionKey(function), FunctionKey(function),
ExpressionInfoList(10, false) ExpressionInfoList(10)
{ {
function->AcquireReference(); function->AcquireReference();
} }
@@ -1792,7 +1792,7 @@ VariablesView::VariablesView(Listener* listener)
fPreviousViewState(NULL), fPreviousViewState(NULL),
fViewStateHistory(NULL), fViewStateHistory(NULL),
fExpressions(NULL), fExpressions(NULL),
fExpressionChildren(10, false), fExpressionChildren(10),
fTableCellContextMenuTracker(NULL), fTableCellContextMenuTracker(NULL),
fPendingTypecastInfo(NULL), fPendingTypecastInfo(NULL),
fTemporaryExpression(NULL), fTemporaryExpression(NULL),
@@ -25,7 +25,7 @@
ValueHandlerRoster::ValueHandlerRoster() ValueHandlerRoster::ValueHandlerRoster()
: :
fLock("value handler roster"), fLock("value handler roster"),
fValueHandlers(20, false) fValueHandlers(20)
{ {
} }
@@ -103,7 +103,7 @@ ValidationFailure::Archive(BMessage* into, bool deep) const
ValidationFailures::ValidationFailures(BMessage* from) ValidationFailures::ValidationFailures(BMessage* from)
: :
fItems(20, true) fItems(20)
{ {
_AddFromMessage(from); _AddFromMessage(from);
} }
@@ -111,7 +111,7 @@ ValidationFailures::ValidationFailures(BMessage* from)
ValidationFailures::ValidationFailures() ValidationFailures::ValidationFailures()
: :
fItems(20, true) fItems(20)
{ {
} }
@@ -61,7 +61,7 @@ private:
ValidationFailure* _GetOrCreateFailure(const BString& property); ValidationFailure* _GetOrCreateFailure(const BString& property);
private: private:
BObjectList<ValidationFailure> BObjectList<ValidationFailure, true>
fItems; fItems;
}; };
+2 -2
View File
@@ -118,7 +118,7 @@ class PeopleChoiceModel : public BAutoCompleter::ChoiceModel {
public: public:
PeopleChoiceModel() PeopleChoiceModel()
: :
fChoices(5, true) fChoices(5)
{ {
} }
@@ -174,7 +174,7 @@ public:
} }
private: private:
BObjectList<BAutoCompleter::Choice> fChoices; BObjectList<BAutoCompleter::Choice, true> fChoices;
}; };
+1 -1
View File
@@ -106,7 +106,7 @@ Person::IsInGroup(const char* group) const
PersonList::PersonList(QueryList& query) PersonList::PersonList(QueryList& query)
: :
fQueryList(query), fQueryList(query),
fPersons(10, true) fPersons(10)
{ {
fQueryList.AddListener(this); fQueryList.AddListener(this);
} }
+1 -1
View File
@@ -61,7 +61,7 @@ private:
typedef std::map<node_ref, Person*> PersonMap; typedef std::map<node_ref, Person*> PersonMap;
QueryList& fQueryList; QueryList& fQueryList;
BObjectList<Person> fPersons; BObjectList<Person, true> fPersons;
PersonMap fPersonMap; PersonMap fPersonMap;
}; };
+1 -1
View File
@@ -40,7 +40,7 @@ QueryListener::~QueryListener()
QueryList::QueryList() QueryList::QueryList()
: :
fQuit(false), fQuit(false),
fListeners(5, true) fListeners(5)
{ {
} }
+1 -1
View File
@@ -69,7 +69,7 @@ private:
QueryVector fQueries; QueryVector fQueries;
QueryVector fQueryQueue; QueryVector fQueryQueue;
ThreadVector fFetchThreads; ThreadVector fFetchThreads;
BObjectList<QueryListener> fListeners; BObjectList<QueryListener, true> fListeners;
}; };
@@ -471,7 +471,7 @@ PlaylistWindow::_UpdateTotalDuration(bigtime_t duration)
PlaylistWindow::DurationListener::DurationListener(PlaylistWindow& parent) PlaylistWindow::DurationListener::DurationListener(PlaylistWindow& parent)
: :
PlaylistObserver(this), PlaylistObserver(this),
fKnown(20, true), fKnown(20),
fTotalDuration(0), fTotalDuration(0),
fParent(parent) fParent(parent)
{ {
@@ -70,7 +70,7 @@ private:
int32 index); int32 index);
void _HandleItemRemoved(int32 index); void _HandleItemRemoved(int32 index);
BObjectList<bigtime_t> BObjectList<bigtime_t, true>
fKnown; fKnown;
bigtime_t fTotalDuration; bigtime_t fTotalDuration;
PlaylistWindow& fParent; PlaylistWindow& fParent;
+1 -1
View File
@@ -72,7 +72,7 @@ TPeopleApp::TPeopleApp()
: :
BApplication(APP_SIG), BApplication(APP_SIG),
fWindowCount(0), fWindowCount(0),
fAttributes(20, true) fAttributes(20)
{ {
B_TRANSLATE_MARK_SYSTEM_NAME_VOID("People"); B_TRANSLATE_MARK_SYSTEM_NAME_VOID("People");
+1 -1
View File
@@ -60,7 +60,7 @@ private:
BString name; BString name;
}; };
BObjectList<Attribute> fAttributes; BObjectList<Attribute, true> fAttributes;
}; };
#endif // PEOPLE_APP_H #endif // PEOPLE_APP_H
+1 -1
View File
@@ -47,7 +47,7 @@ PersonView::PersonView(const char* name, const char* categoryAttribute,
BGridView(), BGridView(),
fLastModificationTime(0), fLastModificationTime(0),
fGroups(NULL), fGroups(NULL),
fControls(20, false), fControls(20),
fCategoryAttribute(categoryAttribute), fCategoryAttribute(categoryAttribute),
fPictureView(NULL), fPictureView(NULL),
fSaving(false) fSaving(false)
+1 -1
View File
@@ -28,7 +28,7 @@ struct color_scheme gCustomColorScheme = {
}; };
BObjectList<const color_scheme>* gColorSchemes = NULL; BObjectList<const color_scheme, true>* gColorSchemes = NULL;
bool bool
+1 -1
View File
@@ -56,7 +56,7 @@ struct FindColorSchemeByName : public UnaryPredicate<const color_scheme> {
}; };
extern color_scheme gCustomColorScheme; extern color_scheme gCustomColorScheme;
extern BObjectList<const color_scheme> *gColorSchemes; extern BObjectList<const color_scheme, true> *gColorSchemes;
const uint kANSIColorCount = 16; const uint kANSIColorCount = 16;
const uint kTermColorCount = 256; const uint kTermColorCount = 256;
+1 -1
View File
@@ -270,7 +270,7 @@ SortByName(const color_scheme *lhs, const color_scheme *rhs)
void void
PrefHandler::LoadThemes() PrefHandler::LoadThemes()
{ {
gColorSchemes = new BObjectList<const color_scheme>(10, true); gColorSchemes = new BObjectList<const color_scheme, true>(10);
BStringList paths; BStringList paths;
+2 -2
View File
@@ -93,7 +93,7 @@ TerminalRoster::TerminalRoster()
BHandler("terminal roster"), BHandler("terminal roster"),
fLock("terminal roster"), fLock("terminal roster"),
fClipboard(TERM_SIGNATURE), fClipboard(TERM_SIGNATURE),
fInfos(10, true), fInfos(10),
fOurInfo(NULL), fOurInfo(NULL),
fLastCheckedTime(0), fLastCheckedTime(0),
fListener(NULL), fListener(NULL),
@@ -362,7 +362,7 @@ TerminalRoster::_UpdateInfos(bool checkApps)
count = 0; count = 0;
// create an info list from the message // create an info list from the message
InfoList infos(10, true); InfoList infos(10);
for (int32 i = 0; i < count; i++) { for (int32 i = 0; i < count; i++) {
// get the team's message // get the team's message
BMessage teamData; BMessage teamData;
+1 -1
View File
@@ -76,7 +76,7 @@ private:
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
private: private:
typedef BObjectList<Info> InfoList; typedef BObjectList<Info, true> InfoList;
private: private:
status_t _UpdateInfos(bool checkApps); status_t _UpdateInfos(bool checkApps);
+1 -1
View File
@@ -130,7 +130,7 @@ CDDBLookup::Lookup(CDDBServer& server, const dev_t device, bool dumpOnly,
printf("Looking up CD with CDDB Id %08" B_PRIx32 ".\n", cddbID); printf("Looking up CD with CDDB Id %08" B_PRIx32 ".\n", cddbID);
BObjectList<QueryResponseData> queryResponses(10, true); QueryResponseList queryResponses(10);
status_t result = server.Query(cddbID, toc, queryResponses); status_t result = server.Query(cddbID, toc, queryResponses);
if (result != B_OK) { if (result != B_OK) {
fprintf(stderr, "Error when querying CD: %s\n", strerror(result)); fprintf(stderr, "Error when querying CD: %s\n", strerror(result));
+3 -3
View File
@@ -40,17 +40,17 @@ struct ReadResponseData {
BString artist; BString artist;
BString genre; BString genre;
uint32 year; uint32 year;
BObjectList<TrackData> tracks; BObjectList<TrackData, true> tracks;
ReadResponseData() ReadResponseData()
: :
tracks(20, true) tracks(20)
{ {
} }
}; };
typedef BObjectList<QueryResponseData> QueryResponseList; typedef BObjectList<QueryResponseData, true> QueryResponseList;
class CDDBServer { class CDDBServer {
+1 -1
View File
@@ -131,7 +131,7 @@ SharedImage::_Init(debug_symbol_iterator* iterator)
return error; return error;
// iterate through the symbols // iterate through the symbols
BObjectList<Symbol> symbols(512, true); BObjectList<Symbol, true> symbols(512);
char symbolName[1024]; char symbolName[1024];
int32 symbolType; int32 symbolType;
void* symbolLocation; void* symbolLocation;
+1 -1
View File
@@ -37,7 +37,7 @@ Team::Team()
fID(-1), fID(-1),
fNubPort(-1), fNubPort(-1),
fThreads(), fThreads(),
fImages(20, false) fImages(20)
{ {
fDebugContext.nub_port = -1; fDebugContext.nub_port = -1;
} }
+2 -2
View File
@@ -105,7 +105,7 @@ public:
ThreadManager(port_id debuggerPort) ThreadManager(port_id debuggerPort)
: :
fTeams(20), fTeams(20),
fThreads(20, true), fThreads(20),
fKernelTeam(NULL), fKernelTeam(NULL),
fDebuggerPort(debuggerPort), fDebuggerPort(debuggerPort),
fSummaryProfileResult(NULL) fSummaryProfileResult(NULL)
@@ -492,7 +492,7 @@ private:
private: private:
BObjectList<Team> fTeams; BObjectList<Team> fTeams;
BObjectList<Thread> fThreads; BObjectList<Thread, true> fThreads;
ImageMap fImages; ImageMap fImages;
Team* fKernelTeam; Team* fKernelTeam;
port_id fDebuggerPort; port_id fDebuggerPort;
+3 -3
View File
@@ -59,9 +59,9 @@ namespace
typedef std::map<BPackageInfo, bool> PackageInfos; typedef std::map<BPackageInfo, bool> PackageInfos;
status_t static status_t
parsePackageListFile(const char* packageListFileName, parsePackageListFile(const char* packageListFileName,
BObjectList<BString>* packageFileNames) BObjectList<BString, true>* packageFileNames)
{ {
FILE* packageListFile = fopen(packageListFileName, "r"); FILE* packageListFile = fopen(packageListFileName, "r");
if (packageListFile == NULL) { if (packageListFile == NULL) {
@@ -334,7 +334,7 @@ command_update(int argc, const char* const* argv)
BEntry tempRepositoryFile(tempRepositoryFileName.String()); BEntry tempRepositoryFile(tempRepositoryFileName.String());
BPath targetRepositoryFilePath(targetRepositoryFileName); BPath targetRepositoryFilePath(targetRepositoryFileName);
BObjectList<BString> packageNames(100, true); BObjectList<BString, true> packageNames(100);
if ((result = parsePackageListFile(packageListFileName, &packageNames)) if ((result = parsePackageListFile(packageListFileName, &packageNames))
!= B_OK) { != B_OK) {
listener.PrintError( listener.PrintError(
+1 -1
View File
@@ -116,6 +116,6 @@ CommandManager::GetCommandsForCategory(const char* category,
CommandManager::CommandManager() CommandManager::CommandManager()
: :
fCommands(20, true) fCommands(20)
{ {
} }
+1 -1
View File
@@ -46,7 +46,7 @@ private:
}; };
typedef BObjectList<Command> CommandList; typedef BObjectList<Command, true> CommandList;
class CommandManager { class CommandManager {
@@ -174,7 +174,7 @@ ResolveDependenciesCommand::Execute(int argc, const char* const* argv)
// add repositories // add repositories
BPackagePathMap packagePaths; BPackagePathMap packagePaths;
BObjectList<BSolverRepository> repositories(10, true); BObjectList<BSolverRepository, true> repositories(10);
int32 repositoryIndex = 0; int32 repositoryIndex = 0;
for (int i = 0; i < repositoryDirectoryCount; i++, repositoryIndex++) { for (int i = 0; i < repositoryDirectoryCount; i++, repositoryIndex++) {
const char* directoryPath = repositoryDirectories[i]; const char* directoryPath = repositoryDirectories[i];
+2 -2
View File
@@ -154,7 +154,7 @@ filter_required_packages(const BPackageManager& packageManager,
packagesSet.insert(package); packagesSet.insert(package);
BObjectList<BPackageResolvableExpression> requiresList BObjectList<BPackageResolvableExpression, true> requiresList
= package->Info().RequiresList(); = package->Info().RequiresList();
for (int32 j = 0; j < requiresList.CountItems(); j++) for (int32 j = 0; j < requiresList.CountItems(); j++)
requirements.AppendSpecifier(requiresList.ItemAt(j)->ToString()); requirements.AppendSpecifier(requiresList.ItemAt(j)->ToString());
@@ -172,7 +172,7 @@ filter_required_packages(const BPackageManager& packageManager,
std::set<BSolverPackage*>::const_iterator setIterator = packagesSet.begin(); std::set<BSolverPackage*>::const_iterator setIterator = packagesSet.begin();
for (; setIterator != packagesSet.end(); setIterator++) { for (; setIterator != packagesSet.end(); setIterator++) {
BSolverPackage* package = *setIterator; BSolverPackage* package = *setIterator;
BObjectList<BPackageResolvableExpression> requiresList BObjectList<BPackageResolvableExpression, true> requiresList
= package->Info().RequiresList(); = package->Info().RequiresList();
for (int32 j = 0; j < requiresList.CountItems(); j++) { for (int32 j = 0; j < requiresList.CountItems(); j++) {
if (requiresList.ItemAt(j)->ToString() != unmatched->SelectString()) if (requiresList.ItemAt(j)->ToString() != unmatched->SelectString())
+1 -1
View File
@@ -29,7 +29,7 @@ struct BMergedDirectory::EntryNameSet : std::set<std::string> {
BMergedDirectory::BMergedDirectory(BPolicy policy) BMergedDirectory::BMergedDirectory(BPolicy policy)
: :
BEntryList(), BEntryList(),
fDirectories(10, true), fDirectories(10),
fPolicy(policy), fPolicy(policy),
fDirectoryIndex(0), fDirectoryIndex(0),
fVisitedEntries(NULL) fVisitedEntries(NULL)
@@ -367,7 +367,7 @@ DebugReportGenerator::_DumpLoadedImages(BFile& _output)
status_t status_t
DebugReportGenerator::_DumpAreas(BFile& _output) DebugReportGenerator::_DumpAreas(BFile& _output)
{ {
BObjectList<AreaInfo> areas(20, true); BObjectList<AreaInfo, true> areas(20);
status_t result = fDebuggerInterface->GetAreaInfos(areas); status_t result = fDebuggerInterface->GetAreaInfos(areas);
if (result != B_OK) if (result != B_OK)
return result; return result;
@@ -413,7 +413,7 @@ DebugReportGenerator::_DumpAreas(BFile& _output)
status_t status_t
DebugReportGenerator::_DumpSemaphores(BFile& _output) DebugReportGenerator::_DumpSemaphores(BFile& _output)
{ {
BObjectList<SemaphoreInfo> semaphores(20, true); BObjectList<SemaphoreInfo, true> semaphores(20);
status_t error = fDebuggerInterface->GetSemaphoreInfos(semaphores); status_t error = fDebuggerInterface->GetSemaphoreInfos(semaphores);
if (error != B_OK) if (error != B_OK)
return error; return error;
@@ -470,7 +470,7 @@ TeamDebugger::Init(DebuggerInterface* interface, thread_id threadID, int argc,
ThreadHandler* mainThreadHandler = NULL; ThreadHandler* mainThreadHandler = NULL;
{ {
BObjectList<ThreadInfo> threadInfos(20, true); BObjectList<ThreadInfo, true> threadInfos(20);
status_t error = fDebuggerInterface->GetThreadInfos(threadInfos); status_t error = fDebuggerInterface->GetThreadInfos(threadInfos);
for (int32 i = 0; ThreadInfo* info = threadInfos.ItemAt(i); i++) { for (int32 i = 0; ThreadInfo* info = threadInfos.ItemAt(i); i++) {
::Thread* thread; ::Thread* thread;
@@ -494,7 +494,7 @@ TeamDebugger::Init(DebuggerInterface* interface, thread_id threadID, int argc,
Image* appImage = NULL; Image* appImage = NULL;
{ {
BObjectList<ImageInfo> imageInfos(20, true); BObjectList<ImageInfo, true> imageInfos(20);
status_t error = fDebuggerInterface->GetImageInfos(imageInfos); status_t error = fDebuggerInterface->GetImageInfos(imageInfos);
for (int32 i = 0; ImageInfo* info = imageInfos.ItemAt(i); i++) { for (int32 i = 0; ImageInfo* info = imageInfos.ItemAt(i); i++) {
Image* image; Image* image;
@@ -1922,7 +1922,7 @@ TeamDebugger::_PrepareForTeamExec(TeamExecEvent* event)
fBreakpointManager->RemoveImageBreakpoints(image); fBreakpointManager->RemoveImageBreakpoints(image);
} }
BObjectList<UserBreakpoint> breakpointsToRemove(20, false); BObjectList<UserBreakpoint> breakpointsToRemove(20);
const UserBreakpointList& breakpoints = fTeam->UserBreakpoints(); const UserBreakpointList& breakpoints = fTeam->UserBreakpoints();
for (UserBreakpointList::ConstIterator it = breakpoints.GetIterator(); for (UserBreakpointList::ConstIterator it = breakpoints.GetIterator();
UserBreakpoint* breakpoint = it.Next();) { UserBreakpoint* breakpoint = it.Next();) {
@@ -43,7 +43,7 @@ DebuggerImageDebugInfo::Init()
status_t status_t
DebuggerImageDebugInfo::GetFunctions(const BObjectList<SymbolInfo>& symbols, DebuggerImageDebugInfo::GetFunctions(const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions) BObjectList<FunctionDebugInfo>& functions)
{ {
return SpecificImageDebugInfo::GetFunctionsFromSymbols(symbols, functions, return SpecificImageDebugInfo::GetFunctionsFromSymbols(symbols, functions,
@@ -27,7 +27,7 @@ public:
status_t Init(); status_t Init();
virtual status_t GetFunctions( virtual status_t GetFunctions(
const BObjectList<SymbolInfo>& symbols, const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions); BObjectList<FunctionDebugInfo>& functions);
virtual status_t GetType(GlobalTypeCache* cache, virtual status_t GetType(GlobalTypeCache* cache,
const BString& name, const BString& name,
@@ -266,7 +266,7 @@ struct DwarfImageDebugInfo::TypeNameEntry : TypeNameKey {
TypeNameEntry(const BString& name) TypeNameEntry(const BString& name)
: :
TypeNameKey(name), TypeNameKey(name),
types(10, true) types(10)
{ {
} }
@@ -401,7 +401,7 @@ DwarfImageDebugInfo::Init()
status_t status_t
DwarfImageDebugInfo::GetFunctions(const BObjectList<SymbolInfo>& symbols, DwarfImageDebugInfo::GetFunctions(const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions) BObjectList<FunctionDebugInfo>& functions)
{ {
TRACE_IMAGES("DwarfImageDebugInfo::GetFunctions()\n"); TRACE_IMAGES("DwarfImageDebugInfo::GetFunctions()\n");
@@ -56,7 +56,7 @@ public:
{ return fRelocationDelta; } { return fRelocationDelta; }
virtual status_t GetFunctions( virtual status_t GetFunctions(
const BObjectList<SymbolInfo>& symbols, const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions); BObjectList<FunctionDebugInfo>& functions);
virtual status_t GetType(GlobalTypeCache* cache, virtual status_t GetType(GlobalTypeCache* cache,
const BString& name, const BString& name,
@@ -105,7 +105,7 @@ private:
TypeNameTable; TypeNameTable;
struct TypeEntryInfo; struct TypeEntryInfo;
typedef BObjectList<TypeEntryInfo> TypeEntryList; typedef BObjectList<TypeEntryInfo, true> TypeEntryList;
private: private:
status_t _AddSourceCodeInfo(CompilationUnit* unit, status_t _AddSourceCodeInfo(CompilationUnit* unit,
@@ -46,7 +46,7 @@ ImageDebugInfo::AddSpecificInfo(SpecificImageDebugInfo* info)
status_t status_t
ImageDebugInfo::FinishInit(DebuggerInterface* interface) ImageDebugInfo::FinishInit(DebuggerInterface* interface)
{ {
BObjectList<SymbolInfo> symbols(50, true); BObjectList<SymbolInfo, true> symbols(50);
status_t error = interface->GetSymbolInfos(fImageInfo.TeamID(), status_t error = interface->GetSymbolInfos(fImageInfo.TeamID(),
fImageInfo.ImageID(), symbols); fImageInfo.ImageID(), symbols);
if (error != B_OK) if (error != B_OK)
@@ -24,7 +24,7 @@
ImageDebugLoadingStateHandlerRoster::ImageDebugLoadingStateHandlerRoster() ImageDebugLoadingStateHandlerRoster::ImageDebugLoadingStateHandlerRoster()
: :
fLock("loading state handler roster"), fLock("loading state handler roster"),
fStateHandlers(20, false) fStateHandlers(20)
{ {
} }
@@ -20,7 +20,7 @@ SpecificImageDebugInfo::~SpecificImageDebugInfo()
/*static*/ status_t /*static*/ status_t
SpecificImageDebugInfo::GetFunctionsFromSymbols( SpecificImageDebugInfo::GetFunctionsFromSymbols(
const BObjectList<SymbolInfo>& symbols, const BObjectList<SymbolInfo, true>& symbols,
BObjectList<FunctionDebugInfo>& functions, DebuggerInterface* interface, BObjectList<FunctionDebugInfo>& functions, DebuggerInterface* interface,
const ImageInfo& imageInfo, SpecificImageDebugInfo* info) const ImageInfo& imageInfo, SpecificImageDebugInfo* info)
{ {
@@ -264,7 +264,7 @@ TeamDebugInfo::TeamDebugInfo(DebuggerInterface* debuggerInterface,
fDebuggerInterface(debuggerInterface), fDebuggerInterface(debuggerInterface),
fArchitecture(architecture), fArchitecture(architecture),
fFileManager(fileManager), fFileManager(fileManager),
fSpecificInfos(10, true), fSpecificInfos(10),
fFunctions(NULL), fFunctions(NULL),
fSourceFiles(NULL), fSourceFiles(NULL),
fTypeCache(NULL), fTypeCache(NULL),
@@ -81,7 +81,7 @@ DebuggerInterface::IsPostMortem() const
status_t status_t
DebuggerInterface::GetElfSymbols(const char* filePath, int64 textDelta, DebuggerInterface::GetElfSymbols(const char* filePath, int64 textDelta,
BObjectList<SymbolInfo>& infos) BObjectList<SymbolInfo, true>& infos)
{ {
// open the ELF file // open the ELF file
ElfFile elfFile; ElfFile elfFile;
@@ -106,7 +106,7 @@ status_t
DebuggerInterface::GetElfSymbols(const void* symbolTable, uint32 symbolCount, DebuggerInterface::GetElfSymbols(const void* symbolTable, uint32 symbolCount,
uint32 symbolTableEntrySize, const char* stringTable, uint32 symbolTableEntrySize, const char* stringTable,
uint32 stringTableSize, bool is64Bit, bool swappedByteOrder, uint32 stringTableSize, bool is64Bit, bool swappedByteOrder,
int64 textDelta, BObjectList<SymbolInfo>& infos) int64 textDelta, BObjectList<SymbolInfo, true>& infos)
{ {
size_t symbolTableSize = symbolCount * symbolTableEntrySize; size_t symbolTableSize = symbolCount * symbolTableEntrySize;
SymbolTableLookupSource* source = new(std::nothrow) SymbolTableLookupSource( SymbolTableLookupSource* source = new(std::nothrow) SymbolTableLookupSource(
@@ -131,7 +131,7 @@ DebuggerInterface::GetElfSymbols(const void* symbolTable, uint32 symbolCount,
status_t status_t
DebuggerInterface::GetElfSymbols(ElfSymbolLookup* symbolLookup, DebuggerInterface::GetElfSymbols(ElfSymbolLookup* symbolLookup,
BObjectList<SymbolInfo>& infos) BObjectList<SymbolInfo, true>& infos)
{ {
SymbolInfo symbolInfo; SymbolInfo symbolInfo;
uint32 index = 0; uint32 index = 0;
@@ -64,18 +64,18 @@ public:
virtual status_t GetSystemInfo(SystemInfo& info) = 0; virtual status_t GetSystemInfo(SystemInfo& info) = 0;
virtual status_t GetTeamInfo(TeamInfo& info) = 0; virtual status_t GetTeamInfo(TeamInfo& info) = 0;
virtual status_t GetThreadInfos(BObjectList<ThreadInfo>& infos) virtual status_t GetThreadInfos(BObjectList<ThreadInfo, true>& infos)
= 0; = 0;
virtual status_t GetImageInfos(BObjectList<ImageInfo>& infos) virtual status_t GetImageInfos(BObjectList<ImageInfo, true>& infos)
= 0; = 0;
virtual status_t GetAreaInfos(BObjectList<AreaInfo>& infos) virtual status_t GetAreaInfos(BObjectList<AreaInfo, true>& infos)
= 0; = 0;
virtual status_t GetSemaphoreInfos( virtual status_t GetSemaphoreInfos(
BObjectList<SemaphoreInfo>& infos) BObjectList<SemaphoreInfo, true>& infos)
= 0; = 0;
virtual status_t GetSymbolInfos(team_id team, image_id image, virtual status_t GetSymbolInfos(team_id team, image_id image,
BObjectList<SymbolInfo>& infos) = 0; BObjectList<SymbolInfo, true>& infos) = 0;
virtual status_t GetSymbolInfo(team_id team, image_id image, virtual status_t GetSymbolInfo(team_id team, image_id image,
const char* name, int32 symbolType, const char* name, int32 symbolType,
SymbolInfo& info) = 0; SymbolInfo& info) = 0;
@@ -104,16 +104,16 @@ public:
protected: protected:
status_t GetElfSymbols(const char* filePath, status_t GetElfSymbols(const char* filePath,
int64 textDelta, int64 textDelta,
BObjectList<SymbolInfo>& infos); BObjectList<SymbolInfo, true>& infos);
status_t GetElfSymbols(const void* symbolTable, status_t GetElfSymbols(const void* symbolTable,
uint32 symbolCount, uint32 symbolCount,
uint32 symbolTableEntrySize, uint32 symbolTableEntrySize,
const char* stringTable, const char* stringTable,
uint32 stringTableSize, bool is64Bit, uint32 stringTableSize, bool is64Bit,
bool swappedByteOrder, int64 textDelta, bool swappedByteOrder, int64 textDelta,
BObjectList<SymbolInfo>& infos); BObjectList<SymbolInfo, true>& infos);
status_t GetElfSymbols(ElfSymbolLookup* symbolLookup, status_t GetElfSymbols(ElfSymbolLookup* symbolLookup,
BObjectList<SymbolInfo>& infos); BObjectList<SymbolInfo, true>& infos);
private: private:
struct SymbolTableLookupSource; struct SymbolTableLookupSource;
@@ -179,7 +179,7 @@ CoreFileDebuggerInterface::GetTeamInfo(TeamInfo& info)
status_t status_t
CoreFileDebuggerInterface::GetThreadInfos(BObjectList<ThreadInfo>& infos) CoreFileDebuggerInterface::GetThreadInfos(BObjectList<ThreadInfo, true>& infos)
{ {
int32 count = fCoreFile->CountThreadInfos(); int32 count = fCoreFile->CountThreadInfos();
for (int32 i = 0; i < count; i++) { for (int32 i = 0; i < count; i++) {
@@ -198,7 +198,7 @@ CoreFileDebuggerInterface::GetThreadInfos(BObjectList<ThreadInfo>& infos)
status_t status_t
CoreFileDebuggerInterface::GetImageInfos(BObjectList<ImageInfo>& infos) CoreFileDebuggerInterface::GetImageInfos(BObjectList<ImageInfo, true>& infos)
{ {
int32 count = fCoreFile->CountImageInfos(); int32 count = fCoreFile->CountImageInfos();
for (int32 i = 0; i < count; i++) { for (int32 i = 0; i < count; i++) {
@@ -219,14 +219,14 @@ CoreFileDebuggerInterface::GetImageInfos(BObjectList<ImageInfo>& infos)
status_t status_t
CoreFileDebuggerInterface::GetAreaInfos(BObjectList<AreaInfo>& infos) CoreFileDebuggerInterface::GetAreaInfos(BObjectList<AreaInfo, true>& infos)
{ {
return B_UNSUPPORTED; return B_UNSUPPORTED;
} }
status_t status_t
CoreFileDebuggerInterface::GetSemaphoreInfos(BObjectList<SemaphoreInfo>& infos) CoreFileDebuggerInterface::GetSemaphoreInfos(BObjectList<SemaphoreInfo, true>& infos)
{ {
return B_UNSUPPORTED; return B_UNSUPPORTED;
} }
@@ -234,7 +234,7 @@ CoreFileDebuggerInterface::GetSemaphoreInfos(BObjectList<SemaphoreInfo>& infos)
status_t status_t
CoreFileDebuggerInterface::GetSymbolInfos(team_id team, image_id image, CoreFileDebuggerInterface::GetSymbolInfos(team_id team, image_id image,
BObjectList<SymbolInfo>& infos) BObjectList<SymbolInfo, true>& infos)
{ {
// get the image info // get the image info
const CoreFileImageInfo* imageInfo = fCoreFile->ImageInfoForId(image); const CoreFileImageInfo* imageInfo = fCoreFile->ImageInfoForId(image);

Some files were not shown because too many files have changed in this diff Show More