RosettaCodeData/Task/Memory-allocation/Tcl/memory-allocation-2.tcl

9 lines
211 B
Tcl

package require memalloc
set block [memalloc 1000]
puts "allocated $block at [memaddr $block]"
memset $block 42 79
someOtherCommand [memaddr $block]
puts "$block\[42\] is now [memget $block 42]"
memfree $block