added compile option to use sanitizer and already fixed a few misalignment errors with it

This commit is contained in:
csoler 2019-05-11 22:25:02 +02:00
parent 941df6120a
commit 6a18e242bb
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
8 changed files with 35 additions and 12 deletions

View file

@ -61,7 +61,7 @@ namespace RsMemoryManagement
inline bool chunkOwnsPointer(const Chunk& c,void *p) const
{
return p >= c._data && (static_cast<unsigned char *>(p)-c._data)/_blockSize < _numBlocks ;
return intptr_t(p) >= intptr_t(c._data) && (intptr_t(static_cast<unsigned char *>(p))-intptr_t(c._data))/intptr_t(_blockSize)< intptr_t( _numBlocks );
}
void printStatistics() const ;