Hello,

from the valgrind.h on VALGRIND_MALLOCLIKE_BLOCK:

"'rzB' is the redzone size if the allocator
   can apply redzones -- these are blocks of padding at the start and end of
   each block.  Adding redzones is recommended as it makes it much more likely
   Valgrind will spot block overruns."

Detecting overruns didn't quite work for me though so I dug inside
valgrind source and found in mc_main.c:

      case VG_USERREQ__MALLOCLIKE_BLOCK: {
         Addr p         = (Addr)arg[1];
         SizeT sizeB    =       arg[2];
         //UInt rzB       =       arg[3];    XXX: unused!
         Bool is_zeroed = (Bool)arg[4];

         MC_(new_block) ( tid, p, sizeB, /*ignored*/0, is_zeroed,
                          MC_AllocCustom, MC_(malloc_list) );
         return True;
      }

So it looks like the redzones are completely ignored.

Is the comment out of date or the feature not yet implemented? Can I
just emulate it by adding unaddressable blocks myself at both ends of
the new block?

-- 
Best Regards,
Piotr Jaroszyński

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to