~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to coregrind/m_xarray.c

  • Committer: Benjamin Kerensa
  • Date: 2012-11-21 23:57:58 UTC
  • mfrom: (1.1.16)
  • Revision ID: bkerensa@ubuntu.com-20121121235758-bd1rv5uc5vzov2p6
Merge from debian unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
   This file is part of Valgrind, a dynamic binary instrumentation
8
8
   framework.
9
9
 
10
 
   Copyright (C) 2007-2011 OpenWorks LLP
 
10
   Copyright (C) 2007-2012 OpenWorks LLP
11
11
      info@open-works.co.uk
12
12
 
13
13
   This program is free software; you can redistribute it and/or
311
311
   xa->usedsizeE -= n;
312
312
}
313
313
 
 
314
void VG_(removeIndexXA)( XArray* xao, Word n )
 
315
{
 
316
   struct _XArray* xa = (struct _XArray*)xao;
 
317
   vg_assert(xa);
 
318
   vg_assert(n >= 0);
 
319
   vg_assert(n < xa->usedsizeE);
 
320
   if (n+1 < xa->usedsizeE) {
 
321
      VG_(memmove)( ((char*)xa->arr) + (n+0) * xa->elemSzB,
 
322
                    ((char*)xa->arr) + (n+1) * xa->elemSzB,
 
323
                    (xa->usedsizeE - n - 1) * xa->elemSzB );
 
324
   }
 
325
   xa->usedsizeE--;
 
326
}
 
327
 
314
328
void VG_(getContentsXA_UNSAFE)( XArray* xao,
315
329
                                /*OUT*/void** ctsP,
316
330
                                /*OUT*/Word* usedP )