Hello All: 
    I need clarification on rebol memory allocation. I
programmed in C and Asm for years so am cognizant of
architectural approaches to memory allocation (well, sort
of). Let's say we have a function

my-f: func[][str: make string! 8192 ; untested code
    ; appends much data to str....
]

and that function is called any number of times.

Now, does that mean that rebol has to allocate 8092 bytes
of memory every time that 'my-f is called?

==>>If that is so then would not the following be more
    efficient?

my-obj: make object![         ; untested code
  str: make string! 8192
  _my-f: func[][
    clear str
    ; appends much data to string...
    ] ; end function
  ] ;end object

Would not 'str be allocated just once and that would
be during evaluation of my-obj?

Then 'my-f would only have to reset the "internal data
pointer" which is trivial in terms of overhead.
(presuming my-f would be 'happy' with 8192 bytes)

Comments, nags criticisms appreciated..
TIA
-- 
Tim Johnson <[EMAIL PROTECTED]>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to