static __inline__
void drd_start_using_mem(const Addr a1, const SizeT len)
{
- tl_assert(a1 < a1 + len);
+ tl_assert(a1 <= a1 + len);
if (UNLIKELY(drd_any_address_is_traced()))
{
return NULL;
}
if (is_zeroed) VG_(memset)((void*)p, 0, size);
- s_start_using_mem_callback(p, p + size, 0/*ec_uniq*/);
+
+ tl_assert(p <= p + size);
+ s_start_using_mem_callback(p, size, 0/*ec_uniq*/);
// Only update this stat if allocation succeeded.
cmalloc_bs_mallocd += size;
// Allocate a new chunk.
mc = create_DRD_Chunk(tid, a_new, new_size);
- s_start_using_mem_callback(a_new, a_new + new_size, 0/*ec_uniq*/);
+ s_start_using_mem_callback(a_new, new_size, 0/*ec_uniq*/);
}
else
{
#include "pub_tool_execontext.h" // ExeContext
-typedef void (*StartUsingMem)(const Addr a1, const Addr a2, UInt ec_uniq);
-typedef void (*StopUsingMem)(const Addr a1, const Addr a2);
+typedef void (*StartUsingMem)(const Addr a1, const SizeT len, UInt ec_uniq);
+typedef void (*StopUsingMem)(const Addr a1, const SizeT len);
void drd_register_malloc_wrappers(const StartUsingMem start_using_mem_callback,