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

Re: [ns] delete...



proc delete{} defined in tclcl/tcl-object.tcl

When $o destroy is called, it drops into otcl object destruction procedure
(see otcl doc), at the end, control goes back to tclcl where the c++
shadow object is deleted (that's where, say, ~TcpAgent() is called). 

For the c++ part, as long as all related memory is released, and
(IMPORTANT) nobody will refer to this object in the future, deletion is
safe. The second is very important because other c++/otcl ojbect may still
hold a pointer to this deleted object, and this object may be waiting
to be scheduled in the event queue!!

So as you can see this really depends on the coding of individual
object and there isn't a universal naswer.

For more information on c++/tclcl/otcl interaction, see Kannan's ns
workshop slides or the IEC'2000 ones.

On Mon, 27 Nov 2000, Prashant Desai wrote:

> is there a way to delete memory allocated to agents from the tcl script..
>  or
>  what does the function/command delete do???
> 
> say I have a agent  'client'
> 
> set client [new Http/Client $ns $node]
>  
> can 'delete $client' free the memory allocated to the instance client???
> 
> does delete work for all agents.. ie. tcp,PagePool etc...
> 
> prashant
> 
>