digitalmars.D.learn - associative array re-use
- ViktorKrescvohn (15/15) Nov 26 2008 i have a function that re-use same associative array over and over withi...
- BCS (2/22) Nov 26 2008 No, AA's are built in the GC heap so it can't leak.
- ViktorKrescvohn (2/28) Nov 26 2008 what about normal arrays, and thank you very much
- Jarrett Billingsley (3/4) Nov 26 2008 Everything you allocate is garbage-collected. Arrays, AAs, classes -
- BCS (2/10) Nov 27 2008 unless you break out malloc, but you basicly never need to.
i have a function that re-use same associative array over and over within a loop. and i release the array with 'null' afther each loop, will that be a problem of meamory leak after few thousands loop. sample function as below: void[] [char[]] dict; void[] [char[]] temp; function test() { for (..) { for (...) { temp[name]=value; } dict~=temp; temp=null; } ..do something with dict... } thank you for you help
Nov 26 2008
Reply to ViktorKrescvohn,i have a function that re-use same associative array over and over within a loop. and i release the array with 'null' afther each loop, will that be a problem of meamory leak after few thousands loop. sample function as below: void[] [char[]] dict; void[] [char[]] temp; function test() { for (..) { for (...) { temp[name]=value; } dict~=temp; temp=null; } ..do something with dict... } thank you for you helpNo, AA's are built in the GC heap so it can't leak.
Nov 26 2008
BCS Wrote:Reply to ViktorKrescvohn,what about normal arrays, and thank you very muchi have a function that re-use same associative array over and over within a loop. and i release the array with 'null' afther each loop, will that be a problem of meamory leak after few thousands loop. sample function as below: void[] [char[]] dict; void[] [char[]] temp; function test() { for (..) { for (...) { temp[name]=value; } dict~=temp; temp=null; } ..do something with dict... } thank you for you helpNo, AA's are built in the GC heap so it can't leak.
Nov 26 2008
On Wed, Nov 26, 2008 at 11:23 PM, ViktorKrescvohn <viktor_kv7 bhecn.net> wrote:what about normal arrays, and thank you very muchEverything you allocate is garbage-collected. Arrays, AAs, classes - _everything_.
Nov 26 2008
Reply to Jarrett,On Wed, Nov 26, 2008 at 11:23 PM, ViktorKrescvohn <viktor_kv7 bhecn.net> wrote:unless you break out malloc, but you basicly never need to.what about normal arrays, and thank you very muchEverything you allocate is garbage-collected. Arrays, AAs, classes - _everything_.
Nov 27 2008