njones
11-19-2009, 04:01 PM
Is there a document that describes how the new string handling works? I looked at the available 2.2 documents and threads without much luck other than SNAPpy 2.2 has 7 string buffers that are used as required, and recycled when no longer refereced, in contrast with the two dedicated buffers for concatenation and slicing operations in 2.1?
I know the documentation is under development (when you aren't answering questions like this), but I need at least a basic idea of how they work.
If I have a global variable assigned to a dynamically created string (i.e. a buffer of some type), does that permanently "use up" one of the 7 strings, until maybe the global variable is assigned to a constant string like "". (I think the answer is yes).
If I assign the same global string variable to itself plus another character - does the operation temperarily require 2 string buffers - one to hold the "before" string which is itself the result of a previous concatenation, and a second one to produce the "after" string which is ultimately assigned to the global string variable, or does the operation get by with only one string buffer? Knowing this is important when budgeting the string buffer usage, if the answer is yes, the I really only have 6 buffers available for actual concurrent string storage.
If I assign 3 local string variables using concatenated or sliced string operations does it use up 3 dynamic strings, releasing each as the variable falls out of scope (i.e. when the function exits or at the end of the block in which the string is allocated?). (I'm sure the answer to this is yes also, but I don't want to assume).
Is there dedicated space reserved for 7 63-character dynamic strings, or is there room for "up to" 7 strings? I need to know if allocation of other variables or string lengths have an impact on string buffer allocation. I don't want to risk intermittent runtime errors due to intermittent buffer unavailability.
I know the documentation is under development (when you aren't answering questions like this), but I need at least a basic idea of how they work.
If I have a global variable assigned to a dynamically created string (i.e. a buffer of some type), does that permanently "use up" one of the 7 strings, until maybe the global variable is assigned to a constant string like "". (I think the answer is yes).
If I assign the same global string variable to itself plus another character - does the operation temperarily require 2 string buffers - one to hold the "before" string which is itself the result of a previous concatenation, and a second one to produce the "after" string which is ultimately assigned to the global string variable, or does the operation get by with only one string buffer? Knowing this is important when budgeting the string buffer usage, if the answer is yes, the I really only have 6 buffers available for actual concurrent string storage.
If I assign 3 local string variables using concatenated or sliced string operations does it use up 3 dynamic strings, releasing each as the variable falls out of scope (i.e. when the function exits or at the end of the block in which the string is allocated?). (I'm sure the answer to this is yes also, but I don't want to assume).
Is there dedicated space reserved for 7 63-character dynamic strings, or is there room for "up to" 7 strings? I need to know if allocation of other variables or string lengths have an impact on string buffer allocation. I don't want to risk intermittent runtime errors due to intermittent buffer unavailability.