Skip to content
Snippets Groups Projects
Commit c089f849 authored by Markus Blatt's avatar Markus Blatt
Browse files

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
parent be1f68a8
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