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