Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30455
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2014-11-29 23:54 -0800 |
| Message-ID | <91e0be65-71fb-4bbd-a509-0a0a8bf22f84@googlegroups.com> (permalink) |
| Subject | Implementing TCL/CCI commands in JavaTCL |
| From | nataraja.3.833@gmail.com |
I'm trying to implement CCI ( common command interface ) using collections as in Synposis TCL-EDA suite ( http://www.eda.org/edps/edp04/submissions/presentationDwight2.pdf) I'm not able to think of proper memory management while using CCI , let me give an example ## sizeof_collection will return the collection size ( integer ) dc_shell> sizeof_collection [get_cells reset_port*] 4 ## get_cells will return a pointer to a collection , actually it is an index of a collection list dc_shell> get_cells reset_port* 0x10 ## below command will give error as CCI engine has free'd up memory ( no references pointing to collection ) dc_shell>sizeof_collection 0x10 TCL ERROR ## now set the collection to a variable , collection pointer increments by one . dc_shell> set a [get_cells reset_port*] 0x11 ## Now the sizeof_collection returns correct value , i.e collection is still in memory dc_shell> sizeof_collection $a 4 dc_shell>puts $a 0x11 ## Even in this case sizeof_collection returns the correct value , as it has reference ( pointed by variable "a" ) dc_shell > sizeof_collection 0x11 4 ### Clear reference pointer dc_shell > set a "" ## Now we will get error , as the reference from a has been removed !! dc_shell > sizeof_collection 0x11 TCL ERROR Can you tell me know to keep track of TCL_Object and free resources when there are no references pointing to them . and I'm using TCL-Java where garbage collection is been done by Java.GC this is another headache ! Jacl Page : http://wiki.tcl.tk/1637 Regards Nataraja G
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Implementing TCL/CCI commands in JavaTCL nataraja.3.833@gmail.com - 2014-11-29 23:54 -0800
Re: Implementing TCL/CCI commands in JavaTCL Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-30 17:40 +0000
Re: Implementing TCL/CCI commands in JavaTCL nataraja gadikota <nataraja.3.833@gmail.com> - 2014-11-30 21:44 -0800
csiph-web