Skip to content
Snippets Groups Projects
Commit 767ea845 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Merge branch 'cherry-pick-b5a0d2ed' into 'releases/2.5'

Merge branch 'bugfix/poolallocator-debug' into 'master'

Add correct offset for end of chunk

Using `&current->chunk_ + x` will add `x * sizeof(current->chunk_)` to
the pointer, but we only want to add `x`.

Adding a much larger number still "works" on 64bit systems (although it
does not perform the intended check). However on 32bit platforms this
wraps (at least in the way used by sllisttest.cc) and the "end" of the
chunk is suddenly before the beginning.

Closes #57

See merge request !181

See merge request !182
parents be1f68a8 c089f849
Branches
Tags
2 merge requests!533Update CI for 2.5 release branch,!182Merge branch 'bugfix/poolallocator-debug' into 'master'
Pipeline #
......@@ -525,8 +525,8 @@ namespace Dune
#ifndef NDEBUG
Chunk* current=chunks_;
while(current) {
if(static_cast<void*>(&current->chunk_)<=b &&
static_cast<void*>((&current->chunk_)+chunkSize)>b)
if(static_cast<void*>(current->chunk_)<=b &&
static_cast<void*>(current->chunk_+chunkSize)>b)
break;
current=current->next_;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment