[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Buffer:free

cache/uncache has nothing to do with buffer numbers. It's just a mechanism to get b_info replies from the server. Buffer numbers come from the bufferAllocator.

The question is whether it's correct to deallocate the buffer number at the same time that you generate the freeMsg. It could be argued that you just want the message, and it's wrong to release the number until you actually send the freeMsg. Then the user is responsible for calling server.bufferAllocator.free(bufnum) at the time of sending the message.

That might be OK. If you're using freeMsg, probably we can assume you know what you're doing.

On Dec 14, 2008, at 5:12 PM, Jan T wrote:

i'm doing some NRT rendering with Buffers. And i'm using Buffer's methods to generate osc messages. In my case it's not very convenient how Buffer:free works.
It uncaches in the freeMsg, which means when i use this method when generating osc messages and Scores, my Buffer number is always 0. 
Could we move this.uncache to free? 


free { arg completionMessage;
server.listSendMsg( this.freeMsg(completionMessage) );
freeMsg { arg completionMessage;
^["/b_free", bufnum, completionMessage.value(this)];


: H. James Harkins

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman