--- parser3/src/main/Attic/pa_array.C 2001/05/15 15:51:05 1.32 +++ parser3/src/main/Attic/pa_array.C 2001/05/16 16:48:56 1.33 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_array.C,v 1.32 2001/05/15 15:51:05 parser Exp $ + $Id: pa_array.C,v 1.33 2001/05/16 16:48:56 parser Exp $ */ #include "pa_config_includes.h" @@ -15,9 +15,30 @@ #include "pa_exception.h" #include "pa_common.h" +#include "pa_sapi.h" +#define ARRAY_STAT_MAX_PIECES 1000 +int array_stat_pieces[ARRAY_STAT_MAX_PIECES]; +void log_array_stats(Pool& pool) { + for(int i=0; i( malloc(sizeof(int)+sizeof(Chunk::Row)*initial_rows+sizeof(Chunk *))); @@ -32,8 +53,12 @@ Array::Array(Pool& apool, int initial_ro } void Array::expand(int chunk_rows) { - if(chunk_rows( malloc(sizeof(int)+sizeof(Chunk::Row)*chunk_rows+sizeof(Chunk *))); @@ -51,6 +76,13 @@ Array& Array::operator += (Item *src) { append_here->item=src; append_here++; fused_rows++; + { + int index=min(fused_rows, ARRAY_STAT_MAX_LEN-1); + if(index) + array_stat_lens[index-1]++; + array_stat_lens[index]++; + } + return *this; } @@ -59,7 +91,7 @@ Array::Item *Array::get(int index) const if(!(index>=0 && index=0 && index