mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-02 09:58:06 +00:00
Provide malloc-free sentinels for the SparseBitVector internals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04cb564c8d
commit
deda7b6e75
@ -262,6 +262,22 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <unsigned ElementSize>
|
||||
struct ilist_traits<SparseBitVectorElement<ElementSize> >
|
||||
: public ilist_default_traits<SparseBitVectorElement<ElementSize> > {
|
||||
typedef SparseBitVectorElement<ElementSize> Element;
|
||||
|
||||
Element *createSentinel() const { return static_cast<Element *>(&Sentinel); }
|
||||
static void destroySentinel(Element *) {}
|
||||
|
||||
Element *provideInitialHead() const { return createSentinel(); }
|
||||
Element *ensureHead(Element *) const { return createSentinel(); }
|
||||
static void noteHead(Element *, Element *) {}
|
||||
|
||||
private:
|
||||
mutable ilist_half_node<Element> Sentinel;
|
||||
};
|
||||
|
||||
template <unsigned ElementSize = 128>
|
||||
class SparseBitVector {
|
||||
typedef ilist<SparseBitVectorElement<ElementSize> > ElementList;
|
||||
|
Loading…
x
Reference in New Issue
Block a user