Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default Strings
#1
I don´t know about the default strings, but old compilers had options to select string length, my question is about effect of retail length of strings. Example: DefaultShort=8 chars DefaultLong=32 chars.
What do you think of this?
Reply
#2
compiuter Wrote:I don´t know about the default strings, but old compilers had options to select string length, my question is about effect of retail length of strings. Example: DefaultShort=8 chars DefaultLong=32 chars.
What do you think of this?

String length here are dynamic. They only take 2 + LEN(string) bytes in memory. When a string grows (e.g. A$ = A$ + " "), the block is resized and/or reallocated. Then the string shortens (e.g. A$ = A$(2 TO) or the like). Nothing is done... unless the length decreased 4 or more bytes. In such case, the block is resized and/or reallocated and the memory freed.

Upon each block realloacation, the heap is defragmented.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)