C (251/304)

From:Rod Schnell
Date:29 Aug 2000 at 15:02:47
Subject:Re: Freeing list with Classact

----- Original Message -----
From: "Jack York" <jyork@voyager.net>
To: <amiga-c@egroups.com>
Sent: Tuesday, August 29, 2000 7:17 AM
Subject: ga-c] Re: Freeing list with Cla

> Hello Rod
>
> Yes, absolutely sure. But your question did bring up another clue.
> This is basically what I do when I generate the two lists:
>
> struct mystruct *temp; //dynamically allocated - not shown
>
> for ( i = 0; i < 5000; i++)
> {
> strcpy(temp->name, "some name"); //also fill in rest of struct
>
> AddToList( list_1, temp);
> AddToList( list_2, temp);
> }
> And when I free these two lists, the first takes about 20 seconds while
> the second takes about 3. But if I only generate the first list with the
> above method and then generate the second list from it, like this:
>

Hard to comment on without seeing your AddToList() function.

> both lists free in about 3 seconds. I'm not doing anything special in the
> AddToList function. Just allocate a node, copy the contents of temp
> to it and add it to the list. I appreciate your assistance with this. If
> it would make it easier for you I can send you the code for this example
> listbrowser. It's pretty short.

Yes, that would be best.

Regards, Rod