[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: AW: Assignment of tables?
- From: Tobias Käs <tobias.kaes@...>
- Date: Sun, 16 Nov 2003 19:26:37 +0100
> lets say I need to reset a table to some older state. Will this work?:
> MyTable = OlderTable;
> and what would happen to C refs which are attached to 'MyTable'?
With the assignment you only assign a reference to the table.
After this instruction, both MyTable and OlderTable refer to the
same structure. If you change one, the change is visible from the
If MyTable was the only reference to that table, before you re-
assigned it, the table still stays in memory and will sometime
be collected by the garbage collector (at least at program exit).
If there are other references left, nothing will happen to the table.