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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mc_malloc_wrappers.c b/memcheck/mc_malloc_wrappers.c
index a69627a..337367f 100644
--- a/memcheck/mc_malloc_wrappers.c
+++ b/memcheck/mc_malloc_wrappers.c
@@ -133,7 +133,7 @@
       the mc->data field isn't visible to the leak checker.  If memory
       management is working correctly, any pointer returned by VG_(malloc)
       should be noaccess as far as the client is concerned. */
-   if (!MC_(check_noaccess)( (Addr)mc, sizeof(MC_Chunk), NULL )) {
+   if (!MC_(check_mem_is_noaccess)( (Addr)mc, sizeof(MC_Chunk), NULL )) {
       VG_(tool_panic)("create_MC_Chunk: shadow area is accessible");
    } 
    return mc;
@@ -192,9 +192,9 @@
    VG_(HT_add_node)( table, create_MC_Chunk(tid, p, size, kind) );
 
    if (is_zeroed)
-      MC_(make_readable)( p, size );
+      MC_(make_mem_defined)( p, size );
    else
-      MC_(make_writable)( p, size );
+      MC_(make_mem_undefined)( p, size );
 
    return (void*)p;
 }
@@ -259,7 +259,7 @@
 {
    /* Note: make redzones noaccess again -- just in case user made them
       accessible with a client request... */
-   MC_(make_noaccess)( mc->data-rzB, mc->size + 2*rzB );
+   MC_(make_mem_noaccess)( mc->data-rzB, mc->size + 2*rzB );
 
    /* Put it out of harm's way for a while, if not from a client request */
    if (MC_AllocCustom != mc->allockind) {
@@ -345,7 +345,7 @@
       
    } else if (old_size > new_size) {
       /* new size is smaller */
-      MC_(make_noaccess)( mc->data+new_size, mc->size-new_size );
+      MC_(make_mem_noaccess)( mc->data+new_size, mc->size-new_size );
       mc->size = new_size;
       mc->where = VG_(record_ExeContext)(tid);
       p_new = p_old;
@@ -357,10 +357,10 @@
 
       if (a_new) {
          /* First half kept and copied, second half new, red zones as normal */
-         MC_(make_noaccess)( a_new-MC_MALLOC_REDZONE_SZB, MC_MALLOC_REDZONE_SZB );
+         MC_(make_mem_noaccess)( a_new-MC_MALLOC_REDZONE_SZB, MC_MALLOC_REDZONE_SZB );
          MC_(copy_address_range_state)( (Addr)p_old, a_new, mc->size );
-         MC_(make_writable)( a_new+mc->size, new_size-mc->size );
-         MC_(make_noaccess)( a_new+new_size, MC_MALLOC_REDZONE_SZB );
+         MC_(make_mem_undefined)( a_new+mc->size, new_size-mc->size );
+         MC_(make_mem_noaccess) ( a_new+new_size, MC_MALLOC_REDZONE_SZB );
 
          /* Copy from old to new */
          VG_(memcpy)((void*)a_new, p_old, mc->size);
@@ -403,7 +403,7 @@
       management is working correctly, anything pointer returned by
       VG_(malloc) should be noaccess as far as the client is
       concerned. */
-   if (!MC_(check_noaccess)( (Addr)mp, sizeof(MC_Mempool), NULL )) {
+   if (!MC_(check_mem_is_noaccess)( (Addr)mp, sizeof(MC_Mempool), NULL )) {
       VG_(tool_panic)("MC_(create_mempool): shadow area is accessible");
    } 
 
@@ -428,7 +428,7 @@
    while ( (mc = VG_(HT_Next)(mp->chunks)) ) {
       /* Note: make redzones noaccess again -- just in case user made them
          accessible with a client request... */
-      MC_(make_noaccess)(mc->data-mp->rzB, mc->size + 2*mp->rzB );
+      MC_(make_mem_noaccess)(mc->data-mp->rzB, mc->size + 2*mp->rzB );
    }
    // Destroy the chunk table
    VG_(HT_destruct)(mp->chunks);