Wrapped DRD_() macro around even more function and variable names.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9171 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_error.c b/drd/drd_error.c
index 5c87812..801b9c8 100644
--- a/drd/drd_error.c
+++ b/drd/drd_error.c
@@ -43,23 +43,25 @@
 
 /* Local variables. */
 
-static Bool s_drd_show_conflicting_segments = True;
+static Bool DRD_(s_show_conflicting_segments) = True;
 
 
-void set_show_conflicting_segments(const Bool scs)
+void DRD_(set_show_conflicting_segments)(const Bool scs)
 {
-  s_drd_show_conflicting_segments = scs;
+  DRD_(s_show_conflicting_segments) = scs;
 }
 
-/** Describe a data address range [a,a+len[ as good as possible, for error
- *  messages, putting the result in ai.
+/**
+ * Describe a data address range [a,a+len[ as good as possible, for error
+ * messages, putting the result in ai.
  */
 static
-void describe_malloced_addr(Addr const a, SizeT const len, AddrInfo* const ai)
+void DRD_(describe_malloced_addr)(Addr const a, SizeT const len,
+                                  AddrInfo* const ai)
 {
   Addr data;
 
-  if (drd_heap_addrinfo(a, &data, &ai->size, &ai->lastchange))
+  if (DRD_(heap_addrinfo)(a, &data, &ai->size, &ai->lastchange))
   {
     ai->akind = eMallocd;
     ai->rwoffset = a - data;
@@ -70,11 +72,12 @@
   }
 }
 
-/** Report where an object has been observed for the first time. The printed
- *  call stack will either refer to a pthread_*_init() or a pthread_*lock()
- *  call.
+/**
+ * Report where an object has been observed for the first time. The printed
+ * call stack will either refer to a pthread_*_init() or a pthread_*lock()
+ * call.
  */
-static void first_observed(const Addr obj)
+static void DRD_(first_observed)(const Addr obj)
 {
   DrdClientobj* cl;
 
@@ -91,7 +94,8 @@
 }
 
 static
-void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri)
+void DRD_(drd_report_data_race)(Error* const err,
+                                const DataRaceErrInfo* const dri)
 {
   AddrInfo ai;
   const unsigned descr_size = 256;
@@ -109,7 +113,7 @@
   VG_(get_data_description)(descr1, descr2, descr_size, dri->addr);
   if (descr1[0] == 0)
   {
-    describe_malloced_addr(dri->addr, dri->size, &ai);
+    DRD_(describe_malloced_addr)(dri->addr, dri->size, &ai);
   }
   VG_(message)(Vg_UserMsg,
                "Conflicting %s by thread %d/%d at 0x%08lx size %ld",
@@ -150,7 +154,7 @@
       VG_(message)(Vg_UserMsg, "Allocation context: unknown.");
     }
   }
-  if (s_drd_show_conflicting_segments)
+  if (DRD_(s_show_conflicting_segments))
   {
     DRD_(thread_report_conflicting_segments)(dri->tid,
                                              dri->addr, dri->size,
@@ -161,17 +165,17 @@
   VG_(free)(descr1);
 }
 
-static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)
+static Bool DRD_(drd_tool_error_eq)(VgRes res, Error* e1, Error* e2)
 {
   return False;
 }
 
-static void drd_tool_error_pp(Error* const e)
+static void DRD_(drd_tool_error_pp)(Error* const e)
 {
   switch (VG_(get_error_kind)(e))
   {
   case DataRaceErr: {
-    drd_report_data_race2(e, VG_(get_error_extra)(e));
+    DRD_(drd_report_data_race)(e, VG_(get_error_extra)(e));
     break;
   }
   case MutexErr: {
@@ -193,7 +197,7 @@
                    p->mutex);
     }
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(p->mutex);
+    DRD_(first_observed)(p->mutex);
     break;
   }
   case CondErr: {
@@ -203,7 +207,7 @@
                  VG_(get_error_string)(e),
                  cdei->cond);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(cdei->cond);
+    DRD_(first_observed)(cdei->cond);
     break;
   }
   case CondDestrErr: {
@@ -214,7 +218,7 @@
                  cdi->cond, cdi->mutex,
                  DRD_(DrdThreadIdToVgThreadId)(cdi->tid), cdi->tid);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(cdi->mutex);
+    DRD_(first_observed)(cdi->mutex);
     break;
   }
   case CondRaceErr: {
@@ -225,8 +229,8 @@
                  " by the signalling thread.",
                  cei->cond, cei->mutex);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(cei->cond);
-    first_observed(cei->mutex);
+    DRD_(first_observed)(cei->cond);
+    DRD_(first_observed)(cei->mutex);
     break;
   }
   case CondWaitErr: {
@@ -238,9 +242,9 @@
                  cwei->mutex1,
                  cwei->mutex2);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(cwei->cond);
-    first_observed(cwei->mutex1);
-    first_observed(cwei->mutex2);
+    DRD_(first_observed)(cwei->cond);
+    DRD_(first_observed)(cwei->mutex1);
+    DRD_(first_observed)(cwei->mutex2);
     break;
   }
   case SemaphoreErr: {
@@ -251,7 +255,7 @@
                  VG_(get_error_string)(e),
                  sei->semaphore);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(sei->semaphore);
+    DRD_(first_observed)(sei->semaphore);
     break;
   }
   case BarrierErr: {
@@ -262,7 +266,7 @@
                  VG_(get_error_string)(e),
                  bei->barrier);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(bei->barrier);
+    DRD_(first_observed)(bei->barrier);
     break;
   }
   case RwlockErr: {
@@ -273,7 +277,7 @@
                  VG_(get_error_string)(e),
                  p->rwlock);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(p->rwlock);
+    DRD_(first_observed)(p->rwlock);
     break;
   }
   case HoldtimeErr: {
@@ -289,7 +293,7 @@
                  p->hold_time_ms,
                  p->threshold_ms);
     VG_(pp_ExeContext)(VG_(get_error_where)(e));
-    first_observed(p->synchronization_object);
+    DRD_(first_observed)(p->synchronization_object);
     break;
   }
   case GenericErr: {
@@ -307,7 +311,7 @@
   }
 }
 
-static UInt drd_tool_error_update_extra(Error* e)
+static UInt DRD_(drd_tool_error_update_extra)(Error* e)
 {
   switch (VG_(get_error_kind)(e))
   {
@@ -339,7 +343,7 @@
   }
 }
 
-static Bool drd_tool_error_recog(Char* const name, Supp* const supp)
+static Bool DRD_(drd_tool_error_recog)(Char* const name, Supp* const supp)
 {
   SuppKind skind = 0;
 
@@ -372,12 +376,13 @@
   return True;
 }
 
-static Bool drd_tool_error_read_extra(Int fd, Char* buf, Int nBuf, Supp* supp)
+static
+Bool DRD_(drd_tool_error_read_extra)(Int fd, Char* buf, Int nBuf, Supp* supp)
 {
   return True;
 }
 
-static Bool drd_tool_error_matches(Error* const e, Supp* const supp)
+static Bool DRD_(drd_tool_error_matches)(Error* const e, Supp* const supp)
 {
   switch (VG_(get_supp_kind)(supp))
   {
@@ -385,7 +390,7 @@
   return True;
 }
 
-static Char* drd_tool_error_name(Error* e)
+static Char* DRD_(drd_tool_error_name)(Error* e)
 {
   switch (VG_(get_error_kind)(e))
   {
@@ -406,24 +411,19 @@
   return 0;
 }
 
-static void drd_tool_error_print_extra(Error* e)
-{
-  switch (VG_(get_error_kind)(e))
-  {
-    // VG_(printf)("   %s\n", VG_(get_error_string)(err));
-  }
-}
+static void DRD_(drd_tool_error_print_extra)(Error* e)
+{ }
 
 void DRD_(register_error_handlers)(void)
 {
   // Tool error reporting.
-  VG_(needs_tool_errors)(drd_tool_error_eq,
-                         drd_tool_error_pp,
+  VG_(needs_tool_errors)(DRD_(drd_tool_error_eq),
+                         DRD_(drd_tool_error_pp),
                          True,
-                         drd_tool_error_update_extra,
-                         drd_tool_error_recog,
-                         drd_tool_error_read_extra,
-                         drd_tool_error_matches,
-                         drd_tool_error_name,
-                         drd_tool_error_print_extra);
+                         DRD_(drd_tool_error_update_extra),
+                         DRD_(drd_tool_error_recog),
+                         DRD_(drd_tool_error_read_extra),
+                         DRD_(drd_tool_error_matches),
+                         DRD_(drd_tool_error_name),
+                         DRD_(drd_tool_error_print_extra));
 }
diff --git a/drd/drd_error.h b/drd/drd_error.h
index 4035122..e49ac07 100644
--- a/drd/drd_error.h
+++ b/drd/drd_error.h
@@ -147,7 +147,7 @@
 } GenericErrInfo;
 
 
-void set_show_conflicting_segments(const Bool scs);
+void DRD_(set_show_conflicting_segments)(const Bool scs);
 void DRD_(register_error_handlers)(void);
 
 
diff --git a/drd/drd_main.c b/drd/drd_main.c
index 44f64a3..2424fdb 100644
--- a/drd/drd_main.c
+++ b/drd/drd_main.c
@@ -125,7 +125,7 @@
   if (segment_merging != -1)
     DRD_(thread_set_segment_merging)(segment_merging);
   if (show_confl_seg != -1)
-    set_show_conflicting_segments(show_confl_seg);
+    DRD_(set_show_conflicting_segments)(show_confl_seg);
   if (trace_address)
   {
     const Addr addr = VG_(strtoll16)(trace_address, 0);
@@ -568,7 +568,7 @@
     VG_(message)(Vg_UserMsg,
                  "    mutex: %lld non-recursive lock/unlock events.",
                  DRD_(get_mutex_lock_count)());
-    drd_print_malloc_stats();
+    DRD_(print_malloc_stats)();
   }
 }
 
@@ -615,8 +615,8 @@
   VG_(track_pre_thread_ll_exit)   (drd_thread_finished);
 
   // Other stuff.
-  drd_register_malloc_wrappers(drd_start_using_mem_w_ecu,
-                               drd_stop_using_nonstack_mem);
+  DRD_(register_malloc_wrappers)(drd_start_using_mem_w_ecu,
+                                 drd_stop_using_nonstack_mem);
 
   DRD_(clientreq_init)();
 
diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c
index 5a47ed7..bf8da84 100644
--- a/drd/drd_malloc_wrappers.c
+++ b/drd/drd_malloc_wrappers.c
@@ -38,10 +38,7 @@
 #include "pub_tool_tooliface.h"
 
 
-/*------------------------------------------------------------*/
-/*--- Definitions                                          ---*/
-/*------------------------------------------------------------*/
-
+/* Local type definitions. */
 
 typedef struct _DRD_Chunk {
   struct _DRD_Chunk* next;
@@ -50,25 +47,25 @@
   ExeContext*   where;           // where it was allocated
 } DRD_Chunk;
 
-static StartUsingMem s_start_using_mem_callback;
-static StopUsingMem  s_stop_using_mem_callback;
+
+/* Local variables. */
+
+static StartUsingMem DRD_(s_start_using_mem_callback);
+static StopUsingMem  DRD_(s_stop_using_mem_callback);
 /* Stats ... */
-static SizeT cmalloc_n_mallocs  = 0;
-static SizeT cmalloc_n_frees    = 0;
-static SizeT cmalloc_bs_mallocd = 0;
+static SizeT DRD_(s_cmalloc_n_mallocs)  = 0;
+static SizeT DRD_(s_cmalloc_n_frees)    = 0;
+static SizeT DRD_(s_cmalloc_bs_mallocd) = 0;
+/* Record malloc'd blocks. */
+static VgHashTable DRD_(s_malloc_list) = NULL;
 
 
 /*------------------------------------------------------------*/
 /*--- Tracking malloc'd and free'd blocks                  ---*/
 /*------------------------------------------------------------*/
 
-/* Record malloc'd blocks. */
-static VgHashTable drd_malloc_list = NULL;
-
-
-/* Allocate its shadow chunk, put it on the appropriate list. */
-static
-DRD_Chunk* create_DRD_Chunk(ThreadId tid, Addr p, SizeT size)
+/** Allocate its shadow chunk, put it on the appropriate list. */
+static DRD_Chunk* DRD_(create_chunk)(ThreadId tid, Addr p, SizeT size)
 {
   DRD_Chunk* mc = VG_(malloc)("drd.malloc_wrappers.cDC.1",
                               sizeof(DRD_Chunk));
@@ -86,13 +83,13 @@
 /* Allocate memory and note change in memory available */
 static
 __inline__
-void* drd_new_block(ThreadId tid,
-                    SizeT size, SizeT align,
-                    Bool is_zeroed)
+void* DRD_(new_block)(ThreadId tid,
+                      SizeT size, SizeT align,
+                      Bool is_zeroed)
 {
   Addr p;
 
-  cmalloc_n_mallocs ++;
+  DRD_(s_cmalloc_n_mallocs) ++;
 
   // Allocate and zero
   p = (Addr)VG_(cli_malloc)(align, size);
@@ -100,44 +97,39 @@
     return NULL;
   }
   if (is_zeroed) VG_(memset)((void*)p, 0, size);
-  s_start_using_mem_callback(p, p + size, 0/*ec_uniq*/);
+  DRD_(s_start_using_mem_callback)(p, p + size, 0/*ec_uniq*/);
 
   // Only update this stat if allocation succeeded.
-  cmalloc_bs_mallocd += size;
+  DRD_(s_cmalloc_bs_mallocd) += size;
 
-  VG_(HT_add_node)(drd_malloc_list, create_DRD_Chunk(tid, p, size));
+  VG_(HT_add_node)(DRD_(s_malloc_list), DRD_(create_chunk)(tid, p, size));
 
   return (void*)p;
 }
 
-static
-void* drd_malloc(ThreadId tid, SizeT n)
+static void* DRD_(malloc)(ThreadId tid, SizeT n)
 {
-  return drd_new_block(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
+  return DRD_(new_block)(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
 }
 
-static
-void* drd_memalign(ThreadId tid, SizeT align, SizeT n)
+static void* DRD_(memalign)(ThreadId tid, SizeT align, SizeT n)
 {
-  return drd_new_block(tid, n, align, /*is_zeroed*/False);
+  return DRD_(new_block)(tid, n, align, /*is_zeroed*/False);
 }
 
-static
-void* drd_calloc(ThreadId tid, SizeT nmemb, SizeT size1)
+static void* DRD_(calloc)(ThreadId tid, SizeT nmemb, SizeT size1)
 {
-  return drd_new_block(tid, nmemb*size1, VG_(clo_alignment),
-                       /*is_zeroed*/True);
+  return DRD_(new_block)(tid, nmemb*size1, VG_(clo_alignment),
+                         /*is_zeroed*/True);
 }
 
-static
-__inline__
-void drd_handle_free(ThreadId tid, Addr p)
+static __inline__ void DRD_(handle_free)(ThreadId tid, Addr p)
 {
   DRD_Chunk* mc;
 
-  cmalloc_n_frees++;
+  DRD_(s_cmalloc_n_frees)++;
 
-  mc = VG_(HT_remove)(drd_malloc_list, (UWord)p);
+  mc = VG_(HT_remove)(DRD_(s_malloc_list), (UWord)p);
   if (mc == NULL)
   {
     tl_assert(0);
@@ -146,31 +138,29 @@
   {
     tl_assert(p == mc->data);
     if (mc->size > 0)
-      s_stop_using_mem_callback(mc->data, mc->size);
+      DRD_(s_stop_using_mem_callback)(mc->data, mc->size);
     VG_(cli_free)((void*)p);
     VG_(free)(mc);
   }
 }
 
-static
-void drd_free(ThreadId tid, void* p)
+static void DRD_(free)(ThreadId tid, void* p)
 {
-  drd_handle_free(tid, (Addr)p);
+  DRD_(handle_free)(tid, (Addr)p);
 }
 
-static
-void* drd_realloc(ThreadId tid, void* p_old, SizeT new_size)
+static void* DRD_(realloc)(ThreadId tid, void* p_old, SizeT new_size)
 {
   DRD_Chunk* mc;
   void*     p_new;
   SizeT     old_size;
 
-  cmalloc_n_frees ++;
-  cmalloc_n_mallocs ++;
-  cmalloc_bs_mallocd += new_size;
+  DRD_(s_cmalloc_n_frees) ++;
+  DRD_(s_cmalloc_n_mallocs) ++;
+  DRD_(s_cmalloc_bs_mallocd) += new_size;
 
   /* Remove the old block */
-  mc = VG_(HT_remove)(drd_malloc_list, (UWord)p_old);
+  mc = VG_(HT_remove)(DRD_(s_malloc_list), (UWord)p_old);
   if (mc == NULL) {
     tl_assert(0);
     return NULL;
@@ -188,7 +178,7 @@
   else if (old_size > new_size)
   {
     /* new size is smaller */
-    s_stop_using_mem_callback(mc->data + new_size, old_size);
+    DRD_(s_stop_using_mem_callback)(mc->data + new_size, old_size);
     mc->size = new_size;
     mc->where = VG_(record_ExeContext)(tid, 0);
     p_new = p_old;
@@ -206,12 +196,12 @@
       VG_(memcpy)((void*)a_new, p_old, mc->size);
 
       /* Free old memory */
-      s_stop_using_mem_callback(mc->data, mc->size);
+      DRD_(s_stop_using_mem_callback)(mc->data, mc->size);
       VG_(free)(mc);
 
       // 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*/);
+      mc = DRD_(create_chunk)(tid, a_new, new_size);
+      DRD_(s_start_using_mem_callback)(a_new, a_new + new_size, 0/*ec_uniq*/);
     }
     else
     {
@@ -226,65 +216,62 @@
   // will have removed and then re-added mc unnecessarily.  But that's ok
   // because shrinking a block with realloc() is (presumably) much rarer
   // than growing it, and this way simplifies the growing case.
-  VG_(HT_add_node)(drd_malloc_list, mc);
+  VG_(HT_add_node)(DRD_(s_malloc_list), mc);
 
   return p_new;
 }
 
-static
-void* drd___builtin_new(ThreadId tid, SizeT n)
+static void* DRD_(__builtin_new)(ThreadId tid, SizeT n)
 {
-  void* const result = drd_new_block(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
+  void* const result = DRD_(new_block)(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
   //VG_(message)(Vg_DebugMsg, "__builtin_new(%d, %d) = %p", tid, n, result);
   return result;
 }
 
-static
-void drd___builtin_delete(ThreadId tid, void* p)
+static void DRD_(__builtin_delete)(ThreadId tid, void* p)
 {
   //VG_(message)(Vg_DebugMsg, "__builtin_delete(%d, %p)", tid, p);
-  drd_handle_free(tid, (Addr)p);
+  DRD_(handle_free)(tid, (Addr)p);
 }
 
-static
-void* drd___builtin_vec_new(ThreadId tid, SizeT n)
+static void* DRD_(__builtin_vec_new)(ThreadId tid, SizeT n)
 {
-  return drd_new_block(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
+  return DRD_(new_block)(tid, n, VG_(clo_alignment), /*is_zeroed*/False);
 }
 
-static
-void drd___builtin_vec_delete(ThreadId tid, void* p)
+static void DRD_(__builtin_vec_delete)(ThreadId tid, void* p)
 {
-  drd_handle_free(tid, (Addr)p);
+  DRD_(handle_free)(tid, (Addr)p);
 }
 
-void drd_register_malloc_wrappers(const StartUsingMem start_using_mem_callback,
-                                  const StopUsingMem stop_using_mem_callback)
+void DRD_(register_malloc_wrappers)(const StartUsingMem start_callback,
+                                    const StopUsingMem stop_callback)
 {
-  tl_assert(drd_malloc_list == 0);
-  drd_malloc_list = VG_(HT_construct)("drd_malloc_list");   // a big prime
-  tl_assert(drd_malloc_list != 0);
-  tl_assert(stop_using_mem_callback);
+  tl_assert(DRD_(s_malloc_list) == 0);
+  DRD_(s_malloc_list) = VG_(HT_construct)("drd_malloc_list");   // a big prime
+  tl_assert(DRD_(s_malloc_list) != 0);
+  tl_assert(start_callback);
+  tl_assert(stop_callback);
 
-  s_start_using_mem_callback = start_using_mem_callback;
-  s_stop_using_mem_callback  = stop_using_mem_callback;
+  DRD_(s_start_using_mem_callback) = start_callback;
+  DRD_(s_stop_using_mem_callback)  = stop_callback;
 
-  VG_(needs_malloc_replacement)(drd_malloc,
-                                drd___builtin_new,
-                                drd___builtin_vec_new,
-                                drd_memalign,
-                                drd_calloc,
-                                drd_free,
-                                drd___builtin_delete,
-                                drd___builtin_vec_delete,
-                                drd_realloc,
+  VG_(needs_malloc_replacement)(DRD_(malloc),
+                                DRD_(__builtin_new),
+                                DRD_(__builtin_vec_new),
+                                DRD_(memalign),
+                                DRD_(calloc),
+                                DRD_(free),
+                                DRD_(__builtin_delete),
+                                DRD_(__builtin_vec_delete),
+                                DRD_(realloc),
                                 0);
 }
 
-Bool drd_heap_addrinfo(Addr const a,
-                       Addr* const data,
-                       SizeT* const size,
-                       ExeContext** const where)
+Bool DRD_(heap_addrinfo)(Addr const a,
+                         Addr* const data,
+                         SizeT* const size,
+                         ExeContext** const where)
 {
   DRD_Chunk* mc;
 
@@ -292,8 +279,8 @@
   tl_assert(size);
   tl_assert(where);
 
-  VG_(HT_ResetIter)(drd_malloc_list);
-  while ((mc = VG_(HT_Next)(drd_malloc_list)))
+  VG_(HT_ResetIter)(DRD_(s_malloc_list));
+  while ((mc = VG_(HT_Next)(DRD_(s_malloc_list))))
   {
     if (mc->data <= a && a < mc->data + mc->size)
     {
@@ -310,7 +297,7 @@
 /*--- Statistics printing                                  ---*/
 /*------------------------------------------------------------*/
 
-void drd_print_malloc_stats(void)
+void DRD_(print_malloc_stats)(void)
 {
   DRD_Chunk* mc;
   SizeT     nblocks = 0;
@@ -322,8 +309,8 @@
     return;
 
   /* Count memory still in use. */
-  VG_(HT_ResetIter)(drd_malloc_list);
-  while ((mc = VG_(HT_Next)(drd_malloc_list)))
+  VG_(HT_ResetIter)(DRD_(s_malloc_list));
+  while ((mc = VG_(HT_Next)(DRD_(s_malloc_list))))
   {
     nblocks++;
     nbytes += mc->size;
@@ -334,8 +321,8 @@
                nbytes, nblocks);
   VG_(message)(Vg_DebugMsg, 
                "malloc/free: %lu allocs, %lu frees, %lu bytes allocated.",
-               cmalloc_n_mallocs,
-               cmalloc_n_frees, cmalloc_bs_mallocd);
+               DRD_(s_cmalloc_n_mallocs),
+               DRD_(s_cmalloc_n_frees), DRD_(s_cmalloc_bs_mallocd));
   if (VG_(clo_verbosity) > 1)
     VG_(message)(Vg_DebugMsg, " ");
 }
diff --git a/drd/drd_malloc_wrappers.h b/drd/drd_malloc_wrappers.h
index 89d3b85..e00fcb9 100644
--- a/drd/drd_malloc_wrappers.h
+++ b/drd/drd_malloc_wrappers.h
@@ -26,21 +26,22 @@
 #define __MALLOC_WRAPPERS_H
 
 
-#include "pub_tool_basics.h"     // Bool
-#include "pub_tool_execontext.h" // ExeContext
+#include "drd_basics.h"          /* DRD_() */
+#include "pub_tool_basics.h"     /* Bool */
+#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);
 
 
-void drd_register_malloc_wrappers(const StartUsingMem start_using_mem_callback,
-                                  const StopUsingMem stop_using_mem_callback);
-Bool drd_heap_addrinfo(Addr const a,
-                       Addr* const data,
-                       SizeT* const size,
-                       ExeContext** const where);
-void drd_print_malloc_stats(void);
+void DRD_(register_malloc_wrappers)(const StartUsingMem start_callback,
+                                    const StopUsingMem stop_callback);
+Bool DRD_(heap_addrinfo)(Addr const a,
+                         Addr* const data,
+                         SizeT* const size,
+                         ExeContext** const where);
+void DRD_(print_malloc_stats)(void);
 
 
 #endif // __MALLOC_WRAPPERS_H