1998-07-02 13:42:39 +02:00
|
|
|
/* Virtual array support.
|
2006-01-23 16:16:10 +01:00
|
|
|
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
2003-07-06 18:53:24 +02:00
|
|
|
Free Software Foundation, Inc.
|
1998-07-02 13:42:39 +02:00
|
|
|
Contributed by Cygnus Solutions.
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
This file is part of GCC.
|
1998-07-02 13:42:39 +02:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is free software; you can redistribute it and/or modify it
|
1998-07-02 13:42:39 +02:00
|
|
|
under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
|
|
License for more details.
|
1998-07-02 13:42:39 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
2005-06-25 04:02:01 +02:00
|
|
|
the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
1998-07-02 13:42:39 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
2006-01-23 16:16:10 +01:00
|
|
|
#include "toplev.h"
|
1998-07-02 13:42:39 +02:00
|
|
|
#include "varray.h"
|
2002-06-04 09:11:05 +02:00
|
|
|
#include "ggc.h"
|
2004-01-20 23:08:17 +01:00
|
|
|
#include "hashtab.h"
|
1998-07-02 13:42:39 +02:00
|
|
|
|
|
|
|
#define VARRAY_HDR_SIZE (sizeof (struct varray_head_tag) - sizeof (varray_data))
|
|
|
|
|
2004-01-20 23:08:17 +01:00
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
|
2004-01-25 04:52:42 +01:00
|
|
|
/* Store information about each particular varray. */
|
2004-01-20 23:08:17 +01:00
|
|
|
struct varray_descriptor
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
int allocated;
|
|
|
|
int created;
|
|
|
|
int resized;
|
|
|
|
int copied;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Hashtable mapping varray names to descriptors. */
|
|
|
|
static htab_t varray_hash;
|
|
|
|
|
|
|
|
/* Hashtable helpers. */
|
|
|
|
static hashval_t
|
|
|
|
hash_descriptor (const void *p)
|
|
|
|
{
|
|
|
|
const struct varray_descriptor *d = p;
|
|
|
|
return htab_hash_pointer (d->name);
|
|
|
|
}
|
|
|
|
static int
|
|
|
|
eq_descriptor (const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const struct varray_descriptor *d = p1;
|
|
|
|
return d->name == p2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* For given name, return descriptor, create new if needed. */
|
|
|
|
static struct varray_descriptor *
|
|
|
|
varray_descriptor (const char *name)
|
|
|
|
{
|
|
|
|
struct varray_descriptor **slot;
|
|
|
|
|
|
|
|
if (!varray_hash)
|
|
|
|
varray_hash = htab_create (10, hash_descriptor, eq_descriptor, NULL);
|
|
|
|
|
|
|
|
slot = (struct varray_descriptor **)
|
|
|
|
htab_find_slot_with_hash (varray_hash, name,
|
|
|
|
htab_hash_pointer (name),
|
|
|
|
1);
|
|
|
|
if (*slot)
|
|
|
|
return *slot;
|
|
|
|
*slot = xcalloc (sizeof (**slot), 1);
|
|
|
|
(*slot)->name = name;
|
|
|
|
return *slot;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-01-16 08:28:11 +01:00
|
|
|
/* Do not add any more non-GC items here. Please either remove or GC
|
|
|
|
those items that are not GCed. */
|
2003-02-13 01:41:28 +01:00
|
|
|
|
|
|
|
static const struct {
|
|
|
|
unsigned char size;
|
|
|
|
bool uses_ggc;
|
|
|
|
} element[NUM_VARRAY_DATA] = {
|
|
|
|
{ sizeof (char), 1 },
|
|
|
|
{ sizeof (unsigned char), 1 },
|
|
|
|
{ sizeof (short), 1 },
|
|
|
|
{ sizeof (unsigned short), 1 },
|
|
|
|
{ sizeof (int), 1 },
|
|
|
|
{ sizeof (unsigned int), 1 },
|
|
|
|
{ sizeof (long), 1 },
|
|
|
|
{ sizeof (unsigned long), 1 },
|
|
|
|
{ sizeof (HOST_WIDE_INT), 1 },
|
|
|
|
{ sizeof (unsigned HOST_WIDE_INT), 1 },
|
2004-01-16 08:28:11 +01:00
|
|
|
{ sizeof (void *), 1 },
|
2004-05-13 08:41:07 +02:00
|
|
|
{ sizeof (void *), 0 },
|
2003-02-13 01:41:28 +01:00
|
|
|
{ sizeof (char *), 1 },
|
|
|
|
{ sizeof (struct rtx_def *), 1 },
|
|
|
|
{ sizeof (struct rtvec_def *), 1 },
|
|
|
|
{ sizeof (union tree_node *), 1 },
|
|
|
|
{ sizeof (struct bitmap_head_def *), 1 },
|
|
|
|
{ sizeof (struct reg_info_def *), 0 },
|
2004-05-13 08:41:07 +02:00
|
|
|
{ sizeof (struct basic_block_def *), 1 },
|
2003-02-13 01:41:28 +01:00
|
|
|
{ sizeof (struct elt_list *), 1 },
|
2004-05-13 08:41:07 +02:00
|
|
|
{ sizeof (struct edge_def *), 1 },
|
|
|
|
{ sizeof (tree *), 1 },
|
2002-06-04 09:11:05 +02:00
|
|
|
};
|
|
|
|
|
1998-07-02 13:42:39 +02:00
|
|
|
/* Allocate a virtual array with NUM_ELEMENT elements, each of which is
|
|
|
|
ELEMENT_SIZE bytes long, named NAME. Array elements are zeroed. */
|
|
|
|
varray_type
|
2003-07-06 18:53:24 +02:00
|
|
|
varray_init (size_t num_elements, enum varray_data_enum element_kind,
|
|
|
|
const char *name)
|
1998-07-02 13:42:39 +02:00
|
|
|
{
|
2003-02-13 01:41:28 +01:00
|
|
|
size_t data_size = num_elements * element[element_kind].size;
|
2002-06-04 09:11:05 +02:00
|
|
|
varray_type ptr;
|
2004-01-20 23:08:17 +01:00
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
struct varray_descriptor *desc = varray_descriptor (name);
|
|
|
|
|
|
|
|
desc->created++;
|
|
|
|
desc->allocated += data_size + VARRAY_HDR_SIZE;
|
|
|
|
#endif
|
2003-02-13 01:41:28 +01:00
|
|
|
if (element[element_kind].uses_ggc)
|
2003-07-19 16:47:15 +02:00
|
|
|
ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
|
2002-06-04 09:11:05 +02:00
|
|
|
else
|
2003-07-19 16:47:15 +02:00
|
|
|
ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
|
1998-07-02 13:42:39 +02:00
|
|
|
|
|
|
|
ptr->num_elements = num_elements;
|
1999-12-05 01:20:43 +01:00
|
|
|
ptr->elements_used = 0;
|
2002-06-04 09:11:05 +02:00
|
|
|
ptr->type = element_kind;
|
1999-12-05 01:20:43 +01:00
|
|
|
ptr->name = name;
|
1998-07-02 13:42:39 +02:00
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Grow/shrink the virtual array VA to N elements. Zero any new elements
|
|
|
|
allocated. */
|
|
|
|
varray_type
|
2003-07-06 18:53:24 +02:00
|
|
|
varray_grow (varray_type va, size_t n)
|
1998-07-02 13:42:39 +02:00
|
|
|
{
|
|
|
|
size_t old_elements = va->num_elements;
|
|
|
|
if (n != old_elements)
|
|
|
|
{
|
2003-02-13 01:41:28 +01:00
|
|
|
size_t elem_size = element[va->type].size;
|
2002-06-04 09:11:05 +02:00
|
|
|
size_t old_data_size = old_elements * elem_size;
|
|
|
|
size_t data_size = n * elem_size;
|
2004-01-20 23:08:17 +01:00
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
struct varray_descriptor *desc = varray_descriptor (va->name);
|
|
|
|
varray_type oldva = va;
|
|
|
|
|
|
|
|
if (data_size > old_data_size)
|
|
|
|
desc->allocated += data_size - old_data_size;
|
|
|
|
desc->resized ++;
|
|
|
|
#endif
|
|
|
|
|
2002-06-04 09:11:05 +02:00
|
|
|
|
2003-02-13 01:41:28 +01:00
|
|
|
if (element[va->type].uses_ggc)
|
2003-07-19 16:47:15 +02:00
|
|
|
va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
|
2002-06-04 09:11:05 +02:00
|
|
|
else
|
2003-07-19 16:47:15 +02:00
|
|
|
va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
|
1998-07-02 13:42:39 +02:00
|
|
|
va->num_elements = n;
|
|
|
|
if (n > old_elements)
|
varray.h: Allow compilation with a C++ compiler.
* varray.h: Allow compilation with a C++ compiler.
(union varray_data_tag): Prefix all field names with "vdt_".
(VARRAY_CHAR, VARRAY_UCHAR, VARRAY_SHORT, VARRAY_USHORT,
VARRAY_INT, VARRAY_UINT, VARRAY_LONG, VARRAY_ULONG,
VARRAY_WIDE_INT, VARRAY_UWIDE_INT, VARRAY_GENERIC_PTR,
VARRAY_GENERIC_PTR_NOGC, VARRAY_CHAR_PTR, VARRAY_RTX,
VARRAY_RTVEC, VARRAY_TREE, VARRAY_BITMAP, VARRAY_REG, VARRAY_BB,
VARRAY_ELT_LIST, VARRAY_EDGE, VARRAY_TREE_PTR): Adjust definition.
(VARRAY_PUSH_CHAR, VARRAY_PUSH_UCHAR, VARRAY_PUSH_SHORT,
VARRAY_PUSH_USHORT, VARRAY_PUSH_INT, VARRAY_PUSH_UINT,
VARRAY_PUSH_LONG, VARRAY_PUSH_ULONG, VARRAY_PUSH_WIDE_INT,
VARRAY_PUSH_UWIDE_INT, VARRAY_PUSH_GENERIC_PTR,
VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_PUSH_CHAR_PTR,
VARRAY_PUSH_RTX, VARRAY_PUSH_RTVEC, VARRAY_PUSH_TREE,
VARRAY_PUSH_BITMAP, VARRAY_PUSH_REG, VARRAY_PUSH_BB,
VARRAY_PUSH_EDGE, VARRAY_PUSH_TREE_PTR): Likewise.
(VARRAY_TOP_CHAR, VARRAY_TOP_UCHAR, VARRAY_TOP_SHORT,
VARRAY_TOP_USHORT, VARRAY_TOP_INT, VARRAY_TOP_UINT,
VARRAY_TOP_LONG, VARRAY_TOP_ULONG, VARRAY_TOP_WIDE_INT,
VARRAY_TOP_UWIDE_INT, VARRAY_TOP_GENERIC_PTR,
VARRAY_TOP_GENERIC_PTR_NOGC, VARRAY_TOP_CHAR_PTR, VARRAY_TOP_RTX,
VARRAY_TOP_RTVEC, VARRAY_TOP_TREE, VARRAY_TOP_BITMAP,
VARRAY_TOP_REG, VARRAY_TOP_BB, VARRAY_TOP_EDGE,
VARRAY_TOP_TREE_PTR): Likewise.
* varray.c (varray_grow): Likewise.
(varray_clear): Likewise.
From-SVN: r108399
2005-12-12 10:14:12 +01:00
|
|
|
memset (&va->data.vdt_c[old_data_size], 0, data_size - old_data_size);
|
2004-01-20 23:08:17 +01:00
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
if (oldva != va)
|
|
|
|
desc->copied++;
|
|
|
|
#endif
|
1998-07-02 13:42:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return va;
|
|
|
|
}
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
|
2002-06-04 09:11:05 +02:00
|
|
|
/* Reset a varray to its original state. */
|
|
|
|
void
|
2003-07-06 18:53:24 +02:00
|
|
|
varray_clear (varray_type va)
|
2002-06-04 09:11:05 +02:00
|
|
|
{
|
2003-02-13 01:41:28 +01:00
|
|
|
size_t data_size = element[va->type].size * va->num_elements;
|
2002-06-04 09:11:05 +02:00
|
|
|
|
varray.h: Allow compilation with a C++ compiler.
* varray.h: Allow compilation with a C++ compiler.
(union varray_data_tag): Prefix all field names with "vdt_".
(VARRAY_CHAR, VARRAY_UCHAR, VARRAY_SHORT, VARRAY_USHORT,
VARRAY_INT, VARRAY_UINT, VARRAY_LONG, VARRAY_ULONG,
VARRAY_WIDE_INT, VARRAY_UWIDE_INT, VARRAY_GENERIC_PTR,
VARRAY_GENERIC_PTR_NOGC, VARRAY_CHAR_PTR, VARRAY_RTX,
VARRAY_RTVEC, VARRAY_TREE, VARRAY_BITMAP, VARRAY_REG, VARRAY_BB,
VARRAY_ELT_LIST, VARRAY_EDGE, VARRAY_TREE_PTR): Adjust definition.
(VARRAY_PUSH_CHAR, VARRAY_PUSH_UCHAR, VARRAY_PUSH_SHORT,
VARRAY_PUSH_USHORT, VARRAY_PUSH_INT, VARRAY_PUSH_UINT,
VARRAY_PUSH_LONG, VARRAY_PUSH_ULONG, VARRAY_PUSH_WIDE_INT,
VARRAY_PUSH_UWIDE_INT, VARRAY_PUSH_GENERIC_PTR,
VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_PUSH_CHAR_PTR,
VARRAY_PUSH_RTX, VARRAY_PUSH_RTVEC, VARRAY_PUSH_TREE,
VARRAY_PUSH_BITMAP, VARRAY_PUSH_REG, VARRAY_PUSH_BB,
VARRAY_PUSH_EDGE, VARRAY_PUSH_TREE_PTR): Likewise.
(VARRAY_TOP_CHAR, VARRAY_TOP_UCHAR, VARRAY_TOP_SHORT,
VARRAY_TOP_USHORT, VARRAY_TOP_INT, VARRAY_TOP_UINT,
VARRAY_TOP_LONG, VARRAY_TOP_ULONG, VARRAY_TOP_WIDE_INT,
VARRAY_TOP_UWIDE_INT, VARRAY_TOP_GENERIC_PTR,
VARRAY_TOP_GENERIC_PTR_NOGC, VARRAY_TOP_CHAR_PTR, VARRAY_TOP_RTX,
VARRAY_TOP_RTVEC, VARRAY_TOP_TREE, VARRAY_TOP_BITMAP,
VARRAY_TOP_REG, VARRAY_TOP_BB, VARRAY_TOP_EDGE,
VARRAY_TOP_TREE_PTR): Likewise.
* varray.c (varray_grow): Likewise.
(varray_clear): Likewise.
From-SVN: r108399
2005-12-12 10:14:12 +01:00
|
|
|
memset (va->data.vdt_c, 0, data_size);
|
2002-06-04 09:11:05 +02:00
|
|
|
va->elements_used = 0;
|
|
|
|
}
|
|
|
|
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
/* Check the bounds of a varray access. */
|
|
|
|
|
1999-11-10 18:57:21 +01:00
|
|
|
#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
|
|
|
|
void
|
2003-07-06 18:53:24 +02:00
|
|
|
varray_check_failed (varray_type va, size_t n, const char *file, int line,
|
|
|
|
const char *function)
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
{
|
2004-01-13 03:43:16 +01:00
|
|
|
internal_error ("virtual array %s[%lu]: element %lu out of bounds "
|
|
|
|
"in %s, at %s:%d",
|
2001-07-06 20:12:11 +02:00
|
|
|
va->name, (unsigned long) va->num_elements, (unsigned long) n,
|
2003-07-06 19:01:47 +02:00
|
|
|
function, trim_filename (file), line);
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
}
|
|
|
|
|
2004-01-13 03:43:16 +01:00
|
|
|
void
|
|
|
|
varray_underflow (varray_type va, const char *file, int line,
|
|
|
|
const char *function)
|
|
|
|
{
|
|
|
|
internal_error ("underflowed virtual array %s in %s, at %s:%d",
|
|
|
|
va->name, function, trim_filename (file), line);
|
|
|
|
}
|
|
|
|
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 07:18:44 +02:00
|
|
|
#endif
|
2004-01-20 23:08:17 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-01-20 23:08:17 +01:00
|
|
|
/* Output per-varray statistics. */
|
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
|
|
|
|
/* Used to accumulate statistics about varray sizes. */
|
|
|
|
struct output_info
|
|
|
|
{
|
|
|
|
int count;
|
|
|
|
int size;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Called via htab_traverse. Output varray descriptor pointed out by SLOT
|
|
|
|
and update statistics. */
|
|
|
|
static int
|
|
|
|
print_statistics (void **slot, void *b)
|
|
|
|
{
|
|
|
|
struct varray_descriptor *d = (struct varray_descriptor *) *slot;
|
|
|
|
struct output_info *i = (struct output_info *) b;
|
|
|
|
|
|
|
|
if (d->allocated)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "%-21s %6d %10d %7d %7d\n", d->name,
|
|
|
|
d->created, d->allocated, d->resized, d->copied);
|
|
|
|
i->size += d->allocated;
|
|
|
|
i->count += d->created;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Output per-varray memory usage statistics. */
|
2006-07-07 16:23:57 +02:00
|
|
|
void
|
|
|
|
dump_varray_statistics (void)
|
2004-01-20 23:08:17 +01:00
|
|
|
{
|
|
|
|
#ifdef GATHER_STATISTICS
|
|
|
|
struct output_info info;
|
|
|
|
|
2006-12-23 15:30:36 +01:00
|
|
|
if (varray_hash)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "\nVARRAY Kind Count Bytes Resized copied\n");
|
|
|
|
fprintf (stderr, "-------------------------------------------------------\n");
|
|
|
|
info.count = 0;
|
|
|
|
info.size = 0;
|
|
|
|
htab_traverse (varray_hash, print_statistics, &info);
|
|
|
|
fprintf (stderr, "-------------------------------------------------------\n");
|
|
|
|
fprintf (stderr, "%-20s %7d %10d\n",
|
|
|
|
"Total", info.count, info.size);
|
|
|
|
fprintf (stderr, "-------------------------------------------------------\n");
|
|
|
|
}
|
2004-01-20 23:08:17 +01:00
|
|
|
#endif
|
|
|
|
}
|