Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: why is it c...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 13 Topic 3991 of 4065
Post > Topic >>

Re: why is it called a buffer

by Elizabeth D Rather <erather@[EMAIL PROTECTED] > Apr 9, 2008 at 07:37 AM

Tinkerer wrote:
> Hello, I'm just starting forth..
> The word buffer: has me worried.
> The docs say its purpose is to allocate a temporary buffer
> How temporary? Is there some limitation to its use, or is it just
> another way of saying 'heap' as opposed to 'stack' ?

You do not say what version of Forth you're using, but in the 
implementations I'm familiar with, BUFFER: is equivalent to the sequence

       CREATE <name> <number of bytes>  ALLOT

This actually creates a permanent allocation of data space, so there's 
nothing temporary about it.  And it is *data space*, neither "heap" nor 
"stack".

I suppose someone may have defined it using ALLOCATE (which *is* a 
temporary allocation), but if so, you then have an obligation to FREE 
the space at some point.  I've never seen such a version, though, so I 
suspect that the word "temporary" in the documentation doesn't really 
mean it.  Forth rarely uses temporary allocations or garbage collection, 
though some extensions to Forth do.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310-491-3356
5155 W. Rosecrans Ave. #1018  Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================




 13 Posts in Topic:
why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-09 23:52:07 
Re: why is it called a buffer
Jerry Avins <jya@[EMAI  2008-04-09 11:13:32 
Re: why is it called a buffer
Elizabeth D Rather <er  2008-04-09 07:37:55 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-10 23:04:19 
Re: why is it called a buffer
Clever Monkey <spamtra  2008-04-14 12:56:45 
Re: why is it called a buffer
m_l_g3 <m_l_g3@[EMAIL   2008-04-09 14:02:59 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-10 23:04:19 
Re: why is it called a buffer
Elizabeth D Rather <er  2008-04-10 07:32:27 
Re: why is it called a buffer
tinkerer@[EMAIL PROTECTED  2008-04-15 02:05:03 
Re: why is it called a buffer
Albert van der Horst <  2008-04-17 02:27:04 
Re: why is it called a buffer
vandys@[EMAIL PROTECTED]   2008-04-17 02:33:44 
Re: why is it called a buffer
Bruce McFarling <agila  2008-04-10 09:58:19 
Re: why is it called a buffer
Jonah Thomas <jethomas  2008-04-14 13:31:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 4:35:15 CDT 2008.