This is one question that I repeatedly have encountered as of late: What is the best way to handle a finite resource tracking algorithm?
For example, I might have a specific number of spots set up for working with TBitmap.
Now I could generally start from 1 when I create this object. However, if I have more objects (let's say 3), and I'm done with 1, I can Free the object.
Now what I'm talking about is handling things to be able to reclaim that spot. In other words, use it efficiently? What's generally the best approach? Or am on the wrong track and there's a better way to handle this?
Measurement is not management.
For example, I might have a specific number of spots set up for working with TBitmap.
Code:
bitmap_table: array[1..10] of TBitmap;
Now I could generally start from 1 when I create this object. However, if I have more objects (let's say 3), and I'm done with 1, I can Free the object.
Now what I'm talking about is handling things to be able to reclaim that spot. In other words, use it efficiently? What's generally the best approach? Or am on the wrong track and there's a better way to handle this?
Measurement is not management.