Re: Ver 4.0 allocate() question
- Posted by DerekParnell (admin) Sep 14, 2008
- 842 views
bernie said...
Would'nt it be a good idea to zero out memory internally during the allocate()
Yes it is a good idea. There could be an optional parameter that, by default, caused allocated RAM to be cleared but could also be set so that it didn't clear sometimes. Because sometimes the overhead of clearing it is wasted if all of the allocate RAM is going to be set to some non-zero values regardless of what its current value is. For example, allocating a buffer for an API function that fills the buffer.
So maybe the allocate signature could be changed to
mem = allocate(atom size, integer clear = true)