https://bugs.kde.org/show_bug.cgi?id=367995

            Bug ID: 367995
           Summary: Integration of memcheck with custom memory allocator
           Product: valgrind
           Version: 3.11.0
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: ruurd.beers...@infor.com

Created attachment 100849
  --> https://bugs.kde.org/attachment.cgi?id=100849&action=edit
Patch to support new types of mempool

The 'loosely defined' model for memory pools in valgrind is not sufficient for
our custom allocator. There are 2 problems:
- Destroying a pool without explicitly freeing all items results in leaks being
reported. Our allocator (and apps) allow this and does free & reuse the memory.
- Our allocator uses itself to allocate blocks of memory for the pools to
allocate memory from. Valgrind considers this 'overlapping blocks'  which is a
fatal error.

To support this, I've added a new mempool create call. Internally, 2 extra
flags are maintained internally: One "auto_free" flag to arrange auto-freeing
of chunks from a mempool and one "metablock" flag to prevent the check on
overlapping blocks.
I've added regression test cases for the new options..
I've been using the patched version for a about 5 weeks on various Linux
versions:
- SuSE 11.4
- SuSE 12.1
- RHAT 6.4
- RHAT 7.2 
And it works the way it should.
All regression tests work as before, the added tests show the new
functionality.
I'd appreciate it if this patch would make it to the next version.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to