Author: chromatic
Date: Fri Nov 28 22:30:47 2008
New Revision: 33325
Modified:
trunk/compilers/imcc/imcc.l
trunk/compilers/imcc/imclexer.c
trunk/examples/benchmarks/primes2.pir
Log:
[IMCC] Fixed a memory leak in macros of macro names.
Modified: trunk/compilers/imcc/imcc.l
==============================================================================
--- trunk/compilers/imcc/imcc.l (original)
+++ trunk/compilers/imcc/imcc.l Fri Nov 28 22:30:47 2008
@@ -1075,7 +1075,7 @@
if (!IMCC_INFO(interp)->macros)
parrot_new_cstring_hash(interp, &IMCC_INFO(interp)->macros);
- parrot_hash_put(interp, IMCC_INFO(interp)->macros, str_dup(name), m);
+ parrot_hash_put(interp, IMCC_INFO(interp)->macros, name, m);
}
if (params)
Modified: trunk/compilers/imcc/imclexer.c
==============================================================================
--- trunk/compilers/imcc/imclexer.c (original)
+++ trunk/compilers/imcc/imclexer.c Fri Nov 28 22:30:47 2008
@@ -5616,7 +5616,7 @@
if (!IMCC_INFO(interp)->macros)
parrot_new_cstring_hash(interp, &IMCC_INFO(interp)->macros);
- parrot_hash_put(interp, IMCC_INFO(interp)->macros, str_dup(name), m);
+ parrot_hash_put(interp, IMCC_INFO(interp)->macros, name, m);
}
if (params)
Modified: trunk/examples/benchmarks/primes2.pir
==============================================================================
--- trunk/examples/benchmarks/primes2.pir (original)
+++ trunk/examples/benchmarks/primes2.pir Fri Nov 28 22:30:47 2008
@@ -23,7 +23,7 @@
i = new 'Integer'
i = 0
max = new 'Integer'
- max = 5000
+ max = 1000
i6 = new 'Integer'
i6 = 0
i7 = new 'Integer'