Re: Ver 4.0 allocate() question

new topic     » goto parent     » topic index » view thread      » older message » newer message
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) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu