BBS: Inland Empire Archive Date: 05-19-92 (11:36) Number: 136 From: TIM FITZGERALD Refer#: NONE To: DAVE CLEARY Recvd: NO Subj: Dynamic Arrays?! Conf: (2) Quik_Bas
DC>Garbage collection is done on far memory and dynamic arrays. For instance, DC>say you are allocating and deallocating many dynamic DC>arrays. After a while, far memory will be fragmented. If QB DC>did not do a garbage collection, You could end up with alot DC>of useless memory. I do not know what triggers it. It might DC>be when QB can not allocate an array because of memory DC>fragmentation, or it might be more often than that. Dave, I may be jumping in here, without knowing the full thread of this message.. so if the rest of my reply is out of place, then please ignore. :) This snippet was taken out of a book called "Advanced QuickBasic 4.0" by Murray Lesser. ISBN 0-553-34546-X (p.184) "...Initially, all string descriptors point to null strings, each of zero length with a dummy string-space address. When a value is assigned to a string variable during run time, that value (along with some internal bookkeeping code) is written into string space at the first available location (starting from the bottom of string space), and the proper length and address data ware written into the corresponding string descriptor. If any previously assigned string value is modified, the old value in string space is marked as invalid, a new value is written at the current tip of used string space, and the corresponding string descriptor is updated accordingly. Eventually, there may not be any more string space available when it becomes time to write a new value, so the string-space manager reclaims the invalid string space by moving all still-valid values to the bottom of string space, changing their descriptors accordingly, and resetting the current "top of used string space" to the end of the still-valid values. The technical term for this reclamation is garbage collection." If this info isn't of any use to you Dave, or you Matt, then hopefully it will be of use to someone. Even though the book is copyrighted, I don't thing quotes from the book will violate the copyright? ;) Tim ___ X OLX 2.1 TD X It's only a hobby ... only a hobby ... only a --- Maximus 2.01wb * Origin: The Chatter Box ** Baker, La. (1:3800/18)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET