![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
At this point, your modified analyze_trades
program is complete, and
works fine, but if you run it long enough, it will fill up your computer's
memory with useless trade
objects. If you want to see why, note
that, once one file has been analyzedone that contains, say, three
tradesthe memory involved in the analysis looks as follows:
0 1 2 <-- Trades | | | array v v v index ------------------- ------------------- ----------------- ----*-------------------*-------------------*-------------------*--- | First pointer | Second pointer | Third pointer | ---*---------*---------*---------*---------*---------*---------*---- | | | v v v *-----------------* *-----------------* *-----------------* | First allocated | | Second allocated| | Third allocated | | chunk of memory | | chunk of memory | | chunk of memory | *-----------------* *-----------------* *-----------------*