pool: assert that the pointer for 'index' is within our allocation
This commit is contained in:
parent
4608d24027
commit
425e933f62
6
pool.hpp
6
pool.hpp
@ -225,6 +225,12 @@ namespace cruft {
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
size_t index (T const *ptr) const
|
||||
{
|
||||
CHECK_LIMIT (
|
||||
ptr,
|
||||
reinterpret_cast<T*> (m_store),
|
||||
reinterpret_cast<T*> (m_store) + capacity ()
|
||||
);
|
||||
|
||||
return ptr - reinterpret_cast<T*> (m_store);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user