Mail Archives: djgpp/2002/04/10/14:00:14
Hi all:
I have a problem that I canīt understand.
When download and install gcc 2.95 + djdev203, old programs originally
compiled and linked with gcc 2.82 + djdev201 hoggs memory.
In those programs, I use pointers to pointer of structures typedef''d
previously, because I need sort and search for matches between differents
structures with a common field.
With gcc 2.82 + djdev201, read 118,000 structs needs about 4 MB RAM, and
with gcc 2.95 + djdev203 the program exhaust the RAM (128 MB), or crashes
at the sort function.
At this moment, I read the FAQ, search on the Mail Archives, and I canīt
resolve this problem.
I use Win 98, 128 MB RAM,
Tanks in advance, and excuse me for my poor english
JL
/*the typedef */
typedef struct {
char del [3], afilia[12], folio[10], tipo[5];
int year, f_emi, count, f_nac;
double sum_aseg;
} sumas;
void s_sum(char *s, sumas *t);
/*the function s_sum splits a line of text in fields, and fills the
structure *t */
sumas **l_sumas, ds;
while(fgets(egreso, 199, fp)!=NULL){
s_sum(egreso, &ds);
if(atoi(ds.afilia)>0){
n_sum++;
l_sum=(sumas **)realloc(l_sum, n_sum*sizeof(sumas *));
l_sum[n_sum-1]=(sumas *)calloc(1, sizeof(sumas));
s_sum(egreso, l_sum[n_sum-1]);
}
}
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
- Raw text -