]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Tidy up m_xarray.c.
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 15 Sep 2014 18:50:17 +0000 (18:50 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 15 Sep 2014 18:50:17 +0000 (18:50 +0000)
VG_(newXA) and VG_(cloneXA) never return NULL. Remove pointless asserts.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14539

17 files changed:
coregrind/m_commandline.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/readdwarf.c
coregrind/m_debuginfo/readdwarf3.c
coregrind/m_debuginfo/readmacho.c
coregrind/m_debuginfo/storage.c
coregrind/m_debuginfo/tytypes.c
coregrind/m_deduppoolalloc.c
coregrind/m_errormgr.c
coregrind/m_main.c
coregrind/m_poolalloc.c
coregrind/m_rangemap.c
coregrind/m_xarray.c
drd/drd_error.c
helgrind/hg_main.c
helgrind/libhb_core.c
include/pub_tool_xarray.h

index 85e91b419ea46ac7e29ad9ea4d31c688f1ba6cec..9f020fd5fcad33b5c55b2c18c7a9144ec400b8df 100644 (file)
@@ -164,19 +164,16 @@ void VG_(split_up_argv)( Int argc, HChar** argv )
 
    tmp_xarray = VG_(newXA)( VG_(malloc), "commandline.sua.1",
                             VG_(free), sizeof(HChar*) );
-   vg_assert(tmp_xarray);
 
    vg_assert( ! VG_(args_for_valgrind) );
    VG_(args_for_valgrind)
       = VG_(newXA)( VG_(malloc), "commandline.sua.2",
                     VG_(free), sizeof(HChar*) );
-   vg_assert( VG_(args_for_valgrind) );
 
    vg_assert( ! VG_(args_for_client) );
    VG_(args_for_client)
       = VG_(newXA)( VG_(malloc), "commandline.sua.3",
                     VG_(free), sizeof(HChar*) );
-   vg_assert( VG_(args_for_client) );
 
    /* Collect up the args-for-V. */
    i = 1; /* skip the exe (stage2) name. */
index 285f7c95fa35a80e8fccd37daa30a5e1c40daf55..ab11a5ab5af2c0169156558a41171f9899a0f05c 100644 (file)
@@ -3953,7 +3953,6 @@ void* /* really, XArray* of GlobalBlock */
    /* we'll put the collected variables in here. */
    gvars = VG_(newXA)( ML_(dinfo_zalloc), "di.debuginfo.dggbfd.1",
                        ML_(dinfo_free), sizeof(GlobalBlock) );
-   tl_assert(gvars);
 
    /* any var info at all? */
    if (!di->varinfo)
index 9a076968efe28ece92cdbd5c61d4473889587269..c8021d3524af7fc01aff5d0214eb291d9602c35d 100644 (file)
@@ -2073,7 +2073,6 @@ static Bool summarise_context(/*OUT*/Addr* base,
       if (src && (VG_(sizeXA)(src) > 0) && (!dst)) {
          dst = VG_(newXA)( ML_(dinfo_zalloc), "di.ccCt.1", ML_(dinfo_free),
                            sizeof(CfiExpr) );
-         vg_assert(dst);
          debuginfo->cfsi_exprs = dst;
       }
       conv = copy_convert_CfiExpr_tree
@@ -2152,7 +2151,6 @@ static Bool summarise_context(/*OUT*/Addr* base,
                               "di.ccCt.2",                    \
                               ML_(dinfo_free),                \
                               sizeof(CfiExpr) );              \
-            vg_assert(dst);                                   \
             debuginfo->cfsi_exprs = dst;                      \
          }                                                    \
          conv = copy_convert_CfiExpr_tree                     \
@@ -4125,7 +4123,6 @@ void ML_(read_callframe_info_dwarf3)
          ctx.exprs    = VG_(newXA)( ML_(dinfo_zalloc), "di.rcid.1",
                                     ML_(dinfo_free), 
                                     sizeof(CfiExpr) );
-         vg_assert(ctx.exprs);
 
         /* Run the CIE's instructions.  Ugly hack: if
             --debug-dump=frames is in effect, suppress output for
index a319bf31cd7683409283e8a78607f319187cebb8..afc7b8bc66914d01cd2b2e92af6b1d745b5c0f49 100644 (file)
@@ -4689,7 +4689,6 @@ void new_dwarf3_reader_wrk (
                = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5var",
                              ML_(dinfo_free),
                              sizeof(UInt) );
-            vg_assert(varparser.fndn_ix_Table);
          }
 
          if (VG_(clo_read_inline_info)) {
@@ -4699,7 +4698,6 @@ void new_dwarf3_reader_wrk (
                = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5inl",
                              ML_(dinfo_free),
                              sizeof(UInt) );
-            vg_assert(inlparser.fndn_ix_Table);
          }
 
          /* Now read the one-and-only top-level DIE for this CU. */
@@ -4855,7 +4853,6 @@ void new_dwarf3_reader_wrk (
          = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.9",
                        ML_(dinfo_free), 
                        sizeof(TempVar*) );
-      vg_assert(dioff_lookup_tab);
 
       n = VG_(sizeXA)( tempvars );
       Word first_primary_var = 0;
index 27508178c3f0de51a3f5ea22bb4127dc7d5c15a0..32be819574befd73ffff757facae9b1bce63e80f 100644 (file)
@@ -930,7 +930,6 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di )
                     ML_(dinfo_zalloc), "di.readmacho.candsyms.1",
                     ML_(dinfo_free), sizeof(DiSym)
                  );
-      vg_assert(candSyms);
 
       // extern symbols
       read_symtab(candSyms,
index 689a68f9bdbe3bbe979d7819f483c46993607457..efa04f35ae9b34cb09cabbf9e8c6f47a3e26a4c2 100644 (file)
@@ -1053,7 +1053,6 @@ static void add_var_to_arange (
       /* copy vars into it */
       vg_assert(first->vars);
       nyu->vars = VG_(cloneXA)( "di.storage.avta.1", first->vars );
-      vg_assert(nyu->vars);
       VG_(OSetGen_Insert)( scope, nyu );
       first = nyu;
    }
@@ -1082,7 +1081,6 @@ static void add_var_to_arange (
       /* copy vars into it */
       vg_assert(last->vars);
       nyu->vars = VG_(cloneXA)( "di.storage.avta.2", last->vars );
-      vg_assert(nyu->vars);
       VG_(OSetGen_Insert)( scope, nyu );
       last = nyu;
    }
@@ -1272,7 +1270,6 @@ void ML_(addVar)( struct _DebugInfo* di,
       nyu->vars = VG_(newXA)( ML_(dinfo_zalloc), "di.storage.addVar.3",
                               ML_(dinfo_free),
                               sizeof(DiVariable) );
-      vg_assert(nyu->vars);
       VG_(OSetGen_Insert)( scope, nyu );
    }
 
index abf6c1856b239e3c76d636aaf7aa2672fac5ac97..d80876c5595d09da3c068fad49c32bb9f69f2616 100644 (file)
@@ -754,7 +754,6 @@ XArray* /*HChar*/ ML_(describe_type)( /*OUT*/PtrdiffT* residual_offset,
    XArray* xa = VG_(newXA)( ML_(dinfo_zalloc), "di.tytypes.dt.1",
                             ML_(dinfo_free),
                             sizeof(HChar) );
-   vg_assert(xa);
 
    ty = ML_(TyEnts__index_by_cuOff)(tyents, NULL, ty_cuOff);
 
index 8a203e88e2d20daed7359e163b37e2ab7a3734b7..916f7e8263403fbe54edeceb4d1000d8eb4f1129 100644 (file)
@@ -112,7 +112,7 @@ DedupPoolAlloc* VG_(newDedupPA) ( SizeT  poolSzB,
    ddpa->curpool = NULL;
    ddpa->curpool_limit = NULL;
    ddpa->curpool_free = NULL;
-   vg_assert(ddpa->pools);
+
    return ddpa;
 }
 
index e08cfc879a8f767f0b1ff93eb9bb459e0475a397..02bf0e4bee8f58f305727d1519a7227211c4401e 100644 (file)
@@ -388,7 +388,6 @@ static void gen_suppression(Error* err)
       mode.  So generate it into TEXT. */
    text = VG_(newXA)( VG_(malloc), "errormgr.gen_suppression.1",
                       VG_(free), sizeof(HChar) );
-   vg_assert(text);
 
    /* Ok.  Generate the plain text version into TEXT. */
    VG_(xaprintf)(text, "{\n");
index a1e7a3a93e209ae352df6a8de65873786aa7bfc0..131ac4fb8f1a5f58217fb1fba8148d3ca948abcc 100644 (file)
@@ -2115,7 +2115,6 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
    tl_assert(!addr2dihandle);
    addr2dihandle = VG_(newXA)( VG_(malloc), "main.vm.2",
                                VG_(free), sizeof(Addr_n_ULong) );
-   tl_assert(addr2dihandle);
 
 #  if defined(VGO_linux)
    { Addr* seg_starts;
index 544239de06e7158d99bb9595bfd37f662ea1d408..c9528e8c2ce6c1873997f2ffaab83ca37560bb6a 100644 (file)
@@ -72,7 +72,7 @@ PoolAlloc* VG_(newPA) ( UWord  elemSzB,
    pa->free_fn  = free_fn;
    pa->pools    = VG_(newXA)( alloc_fn, cc, free_fn, sizeof(void*) );
    pa->nextFree = NULL;
-   vg_assert(pa->pools);
+
    return pa;
 }
 
index 96c65373e53b5f5ab78ef1a14481d8def7828191..dcb9b83d9cadefe9e14f60a97fee400fa42cae5c 100644 (file)
@@ -75,7 +75,6 @@ RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT),
    rm->cc       = cc;
    rm->free_fn  = free_fn;
    rm->ranges = VG_(newXA)( alloc_fn, cc, free_fn, sizeof(Range) );
-   vg_assert(rm->ranges);
    /* Add the initial range */
    Range r;
    r.key_min = UWORD_MIN;
index c440bfd3afbcd23ff0f5cedcdca271a8aa4ed955..74ee63102cc16193b2115d8c589236907808b205 100644 (file)
@@ -38,9 +38,9 @@
 /* See pub_tool_xarray.h for details of what this is all about. */
 
 struct _XArray {
-   void* (*alloc) ( const HChar*, SizeT ); /* alloc fn (nofail) */
-   const HChar* cc;                 /* cost centre for alloc */
-   void  (*free) ( void* );         /* free fn */
+   void* (*alloc_fn) ( const HChar*, SizeT ); /* alloc fn (nofail) */
+   const HChar* cc;                    /* cost centre for alloc */
+   void  (*free_fn) ( void* );         /* free fn */
    Int   (*cmpFn) ( const void*, const void* ); /* cmp fn (may be NULL) */
    Word  elemSzB;   /* element size in bytes */
    void* arr;       /* pointer to elements */
@@ -55,7 +55,7 @@ XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
                      void(*free_fn)(void*),
                      Word elemSzB )
 {
-   struct _XArray* xa;
+   XArray* xa;
    /* Implementation relies on Word being signed and (possibly)
       on SizeT being unsigned. */
    vg_assert( sizeof(Word) == sizeof(void*) );
@@ -66,10 +66,9 @@ XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
    vg_assert(free_fn);
    vg_assert(elemSzB > 0);
    xa = alloc_fn( cc, sizeof(struct _XArray) );
-   vg_assert(xa);
-   xa->alloc     = alloc_fn;
+   xa->alloc_fn  = alloc_fn;
    xa->cc        = cc;
-   xa->free      = free_fn;
+   xa->free_fn   = free_fn;
    xa->cmpFn     = NULL;
    xa->elemSzB   = elemSzB;
    xa->usedsizeE = 0;
@@ -79,19 +78,17 @@ XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
    return xa;
 }
 
-XArray* VG_(cloneXA)( const HChar* cc, XArray* xao )
+XArray* VG_(cloneXA)( const HChar* cc, XArray* xa )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
-   struct _XArray* nyu;
+   XArray* nyu;
    const HChar* nyu_cc;
    vg_assert(xa);
-   vg_assert(xa->alloc);
-   vg_assert(xa->free);
+   vg_assert(xa->alloc_fn);
+   vg_assert(xa->free_fn);
    vg_assert(xa->elemSzB >= 1);
    nyu_cc = cc ? cc : xa->cc;
-   nyu = xa->alloc( nyu_cc, sizeof(struct _XArray) );
-   if (!nyu)
-      return NULL;
+   nyu = xa->alloc_fn( nyu_cc, sizeof(struct _XArray) );
+
    /* Copy everything verbatim ... */
    *nyu = *xa;
    nyu->cc = nyu_cc;
@@ -104,46 +101,39 @@ XArray* VG_(cloneXA)( const HChar* cc, XArray* xao )
          element is later added to it, unfortunately. */
       nyu->totsizeE = nyu->usedsizeE;
       /* and allocate .. */
-      nyu->arr = nyu->alloc( nyu->cc, nyu->totsizeE * nyu->elemSzB );
-      if (!nyu->arr) {
-         nyu->free(nyu);
-         return NULL;
-      }
+      nyu->arr = nyu->alloc_fn( nyu->cc, nyu->totsizeE * nyu->elemSzB );
       VG_(memcpy)( nyu->arr, xa->arr, nyu->totsizeE * nyu->elemSzB );
    }
    /* We're done! */
    return nyu;
 }
 
-void VG_(deleteXA) ( XArray* xao )
+void VG_(deleteXA) ( XArray* xa )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
-   vg_assert(xa->free);
+   vg_assert(xa->free_fn);
    if (xa->arr)
-      xa->free(xa->arr);
-   xa->free(xa);
+      xa->free_fn(xa->arr);
+   xa->free_fn(xa);
 }
 
-void VG_(setCmpFnXA) ( XArray* xao, XACmpFn_t compar )
+void VG_(setCmpFnXA) ( XArray* xa, XACmpFn_t compar )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(compar);
    xa->cmpFn  = compar;
    xa->sorted = False;
 }
 
-inline void* VG_(indexXA) ( XArray* xao, Word n )
+inline void* VG_(indexXA) ( XArray* xa, Word n )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(n >= 0);
    vg_assert(n < xa->usedsizeE);
    return ((char*)xa->arr) + n * xa->elemSzB;
 }
 
-static inline void ensureSpaceXA ( struct _XArray* xa )
+static inline void ensureSpaceXA ( XArray* xa )
 {
    if (xa->usedsizeE == xa->totsizeE) {
       void* tmp;
@@ -167,20 +157,18 @@ static inline void ensureSpaceXA ( struct _XArray* xa )
       if (0 && xa->totsizeE >= 10000) 
          VG_(printf)("addToXA: increasing from %ld to %ld\n", 
                      xa->totsizeE, newsz);
-      tmp = xa->alloc(xa->cc, newsz * xa->elemSzB);
-      vg_assert(tmp);
+      tmp = xa->alloc_fn(xa->cc, newsz * xa->elemSzB);
       if (xa->usedsizeE > 0) 
          VG_(memcpy)(tmp, xa->arr, xa->usedsizeE * xa->elemSzB);
       if (xa->arr)
-         xa->free(xa->arr);
+         xa->free_fn(xa->arr);
       xa->arr = tmp;
       xa->totsizeE = newsz;
    }
 }
 
-Word VG_(addToXA) ( XArray* xao, const void* elem )
+Word VG_(addToXA) ( XArray* xa, const void* elem )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(elem);
    vg_assert(xa->totsizeE >= 0);
@@ -195,10 +183,9 @@ Word VG_(addToXA) ( XArray* xao, const void* elem )
    return xa->usedsizeE-1;
 }
 
-Word VG_(addBytesToXA) ( XArray* xao, const void* bytesV, Word nbytes )
+Word VG_(addBytesToXA) ( XArray* xa, const void* bytesV, Word nbytes )
 {
    Word r, i;
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(xa->elemSzB == 1);
    vg_assert(nbytes >= 0);
@@ -216,22 +203,20 @@ Word VG_(addBytesToXA) ( XArray* xao, const void* bytesV, Word nbytes )
    return r;
 }
 
-void VG_(sortXA) ( XArray* xao )
+void VG_(sortXA) ( XArray* xa )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(xa->cmpFn);
    VG_(ssort)( xa->arr, xa->usedsizeE, xa->elemSzB, xa->cmpFn );
    xa->sorted = True;
 }
 
-Bool VG_(lookupXA_UNSAFE) ( XArray* xao, const void* key,
+Bool VG_(lookupXA_UNSAFE) ( XArray* xa, const void* key,
                             /*OUT*/Word* first, /*OUT*/Word* last,
                             Int(*cmpFn)(const void*, const void*) )
 {
    Word  lo, mid, hi, cres;
    void* midv;
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    lo = 0;
    hi = xa->usedsizeE-1;
@@ -264,35 +249,31 @@ Bool VG_(lookupXA_UNSAFE) ( XArray* xao, const void* key,
    }
 }
 
-Bool VG_(lookupXA) ( XArray* xao, const void* key,
+Bool VG_(lookupXA) ( XArray* xa, const void* key,
                      /*OUT*/Word* first, /*OUT*/Word* last )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(xa->cmpFn);
    vg_assert(xa->sorted);
-   return VG_(lookupXA_UNSAFE)(xao, key, first, last, xa->cmpFn);
+   return VG_(lookupXA_UNSAFE)(xa, key, first, last, xa->cmpFn);
 }
 
-Word VG_(sizeXA) ( XArray* xao )
+Word VG_(sizeXA) ( XArray* xa )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    return xa->usedsizeE;
 }
 
-void VG_(dropTailXA) ( XArray* xao, Word n )
+void VG_(dropTailXA) ( XArray* xa, Word n )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(n >= 0);
    vg_assert(n <= xa->usedsizeE);
    xa->usedsizeE -= n;
 }
 
-void VG_(dropHeadXA) ( XArray* xao, Word n )
+void VG_(dropHeadXA) ( XArray* xa, Word n )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(n >= 0);
    vg_assert(n <= xa->usedsizeE);
@@ -311,9 +292,8 @@ void VG_(dropHeadXA) ( XArray* xao, Word n )
    xa->usedsizeE -= n;
 }
 
-void VG_(removeIndexXA)( XArray* xao, Word n )
+void VG_(removeIndexXA)( XArray* xa, Word n )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(n >= 0);
    vg_assert(n < xa->usedsizeE);
@@ -325,9 +305,8 @@ void VG_(removeIndexXA)( XArray* xao, Word n )
    xa->usedsizeE--;
 }
 
-void VG_(insertIndexXA)( XArray* xao, Word n, const void* elem )
+void VG_(insertIndexXA)( XArray* xa, Word n, const void* elem )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    vg_assert(n >= 0);
    vg_assert(n <= xa->usedsizeE);
@@ -346,11 +325,10 @@ void VG_(insertIndexXA)( XArray* xao, Word n, const void* elem )
    xa->sorted = False;
 }
 
-void VG_(getContentsXA_UNSAFE)( XArray* xao,
+void VG_(getContentsXA_UNSAFE)( XArray* xa,
                                 /*OUT*/void** ctsP,
                                 /*OUT*/Word* usedP )
 {
-   struct _XArray* xa = (struct _XArray*)xao;
    vg_assert(xa);
    *ctsP  = (void*)xa->arr;
    *usedP = xa->usedsizeE;
index 12bfeff4915b6109970b2c69b04425cfeaf417f9..7e6b5e12018b0590379244d2ec6a8c3b165cd870 100644 (file)
@@ -171,8 +171,6 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
    tl_assert(dri);
    tl_assert(dri->addr);
    tl_assert(dri->size > 0);
-   tl_assert(descr1);
-   tl_assert(descr2);
 
    (void) VG_(get_data_description)(descr1, descr2, dri->addr);
    /* If there's nothing in descr1/2, free them.  Why is it safe to to
index 445395420de3d9314363aa936d0095d169e2bc09..673e41380d2a122cba58c4e09c9f9dd010331b85 100644 (file)
@@ -2946,7 +2946,6 @@ static void evh__HG_PTHREAD_BARRIER_INIT_PRE ( ThreadId tid,
                                  sizeof(Thread*) );
    }
 
-   tl_assert(bar->waiting);
    tl_assert(VG_(sizeXA)(bar->waiting) == 0);
    bar->initted   = True;
    bar->resizable = resizable == 1 ? True : False;
index e1a18a7c9ab633167cacd26bd2cc8c85f51b511c..3659aadfa8be72a8699c296e8076761efe6288a9 100644 (file)
@@ -1846,7 +1846,6 @@ static void verydead_thread_table_init ( void )
      = VG_(newXA)( HG_(zalloc),
                    "libhb.verydead_thread_table_init.1",
                    HG_(free), sizeof(ThrID) );
-   tl_assert(verydead_thread_table);
    VG_(setCmpFnXA)(verydead_thread_table, cmp__ThrID);
 }
 
@@ -2562,12 +2561,9 @@ static Word vts_next_GC_at = 1000;
 
 static void vts_tab_init ( void )
 {
-   vts_tab
-      = VG_(newXA)( HG_(zalloc), "libhb.vts_tab_init.1",
-                    HG_(free), sizeof(VtsTE) );
-   vts_tab_freelist
-      = VtsID_INVALID;
-   tl_assert(vts_tab);
+   vts_tab = VG_(newXA)( HG_(zalloc), "libhb.vts_tab_init.1",
+                         HG_(free), sizeof(VtsTE) );
+   vts_tab_freelist = VtsID_INVALID;
 }
 
 /* Add ii to the free list, checking that it looks out-of-use. */
@@ -3677,7 +3673,6 @@ static Thr* Thr__new ( void )
    if (!thrid_to_thr_map) {
       thrid_to_thr_map = VG_(newXA)( HG_(zalloc), "libhb.Thr__new.4",
                                      HG_(free), sizeof(Thr*) );
-      tl_assert(thrid_to_thr_map);
    }
 
    if (thrid_counter >= ThrID_MAX_VALID) {
index 086f0f4e4463b54278a1d7fa155c29962d5319ab..73b9eab8692210ad552ee105004fad8c061638de 100644 (file)
@@ -51,8 +51,9 @@ typedef  struct _XArray  XArray;
 typedef Int (*XACmpFn_t)(const void *, const void *);
 
 /* Create new XArray, using given allocation and free function, and
-   for elements of the specified size.  Alloc fn must not fail (that
-   is, if it returns it must have succeeded.) */
+   for elements of the specified size.  alloc_fn must not return NULL (that
+   is, if it returns it must have succeeded.)
+   This function never returns NULL. */
 extern XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT), 
                             const HChar* cc,
                             void(*free_fn)(void*),
@@ -136,10 +137,9 @@ extern void VG_(insertIndexXA)( XArray*, Word, const void* elem );
 
 /* Make a new, completely independent copy of the given XArray, using
    the existing allocation function to allocate the new space.
-   Returns NULL if the allocation function didn't manage to allocate
-   space (but did return NULL rather than merely abort.)  Space for
-   the clone (and all additions to it) is billed to 'cc' unless that
-   is NULL, in which case the parent's cost-center is used. */
+   Space for the clone (and all additions to it) is billed to 'cc' unless
+   that is NULL, in which case the parent's cost-center is used.
+   Ths function never returns NULL. */
 extern XArray* VG_(cloneXA)( const HChar* cc, XArray* xa );
 
 /* Get the raw array and size so callers can index it really fast.