9 Commits

Author SHA1 Message Date
Philippe Waroquiers
825fdcf3cb Ensure VALGRIND_MALLOCLIKE_BLOCK protects the red zones.
* Redzones for custom alloc were not protected by VALGRIND_MALLOCLIKE_BLOCK.
  mc_main.c client request handling completed with protection
  of the redzones.
* custom_alloc.c test modified to test this case.
* mc_errors.c modified so as to first search for a malloc-ed block
  bracketting the error : for a custom allocator, a recently freed
  block can have just been re-allocated.
  In such a case, describing the address (e.g. in case of error)
  points to the block freed rather than to the block just allocated.
  If there is *also* a recently freed block bracketting the address,
  the block description is changed to indicate that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12439
2012-03-11 17:59:00 +00:00
Julian Seward
b8a03bdc8e Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), in the test suite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11675
2011-03-28 21:19:00 +00:00
Bart Van Assche
9df672f236 Add VALGRIND_RESIZEINPLACE_BLOCK() and hence close #267819.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11666
2011-03-25 20:07:25 +00:00
Nicholas Nethercote
024171ae89 Uncomment this; not sure why it was commented out.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10597
2009-07-24 20:48:36 +00:00
Nicholas Nethercote
2a7a73345f Ignore MALLOCLIKE_BLOCK/FREELIKE_BLOCK if addr==0. Fixes bug 137073. DRD
now has its own copy of custom_alloc.c which is a little different to
Memcheck's;  making them both work with the same version was too difficult.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10455
2009-07-15 02:31:45 +00:00
Nicholas Nethercote
f3f801ed48 Merge r9533..9536 (add tests/{asm.h,sys_mman.h,malloc.h} from the DARWIN
branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9537
2009-04-15 03:12:43 +00:00
Nicholas Nethercote
3d12e0e9db Terminology change: previously in Memcheck we had the four states:
noaccess, writable, readable, other

Now they are:

   noaccess, undefined, defined, partdefined

As a result, the following names:

   make_writable, make_readable,
   check_writable, check_readable, check_defined

have become:

   make_mem_undefined, make_mem_defined,
   check_mem_is_addressable, check_mem_is_defined, check_value_is_defined

(and likewise for the upper-case versions for client request macros).
The old MAKE_* and CHECK_* macros still work for backwards compatibility.

This is much better, because the old names were subtly misleading.  For
example:

  - "readable" really meant "readable and writable".
  - "writable" really meant "writable and maybe readable, depending on how
    the read value is used".
  - "check_writable" really meant "check writable or readable"

The new names avoid these problems.

The recently-added macro which was called MAKE_DEFINED is now
MAKE_MEM_DEFINED_IF_ADDRESSABLE.

I also corrected the spelling of "addressable" in numerous places in
memcheck.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5802
2006-03-31 11:57:59 +00:00
Dirk Mueller
1811b4b5c0 Fix compilation on FreeBSD. extracted from patch by Doug Rabson <dfr@nlsystems.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2167
2004-01-03 14:18:02 +00:00
Nicholas Nethercote
40571c6f66 Added VALGRIND_MALLOCLIKE_BLOCK and VALGRIND_FREELIKE_BLOCK which allow you to
use a custom-allocator and detect almost as many errors as you could detect if
you used malloc/new/new[].  (eg. leaks detected, free errors, free mismatch,
etc).

Had to fiddle with mac_malloc_wrappers.c a bit to factor out the appropriate
code to be called from the client request handling code.  Also had to add a
new element `MAC_AllocCustom' to the MAC_AllocKind type.

Also added a little documentation, and a regression test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1643
2003-05-20 16:38:24 +00:00