On Wed, Jan 29, 2003 at 09:19:26PM +0300, Dmitry wrote:
> 
> Wow!
> does malloc() really works ???
> I _never_ ever tested malloc once written :)
> 
> What a nice surprize :)
> 

Yes Dmitry, it works.

I've used it a lot of times. Mostly in some circular buffer programs,
that I have functions similar to:

int main() {
  char a;
  struct circbuf * cb;
  cb=circbuf_create(30); /* creates a circular buffer with size 30 (uses
                            malloc) */
  circbuf_post(cb,0x40); /* post a data to the buffer */
  a=circbuf_pend(cb);    /* pend a data from the buffer */
  circbuf_destroy(cb);   /* uses free to dealloc the 30 bytes */
 }

It is really great to use malloc and free in msp. It helps a lot!

Reply via email to