Commit a4a6c7dc authored by Kevin Modzelewski's avatar Kevin Modzelewski

Save the str in the striterator

parent 35bc4d48
......@@ -40,7 +40,7 @@ static Box* enable() {
void setupGC() {
BoxedModule* gc_module = createModule("gc", "__builtin__");
gc_module->giveAttr("__hex__", new BoxedBuiltinFunctionOrMethod(boxRTFunction((void*)gcCollect, NONE, 0)));
gc_module->giveAttr("collect", new BoxedBuiltinFunctionOrMethod(boxRTFunction((void*)gcCollect, NONE, 0)));
gc_module->giveAttr("isenabled", new BoxedBuiltinFunctionOrMethod(boxRTFunction((void*)isEnabled, BOXED_BOOL, 0)));
gc_module->giveAttr("disable", new BoxedBuiltinFunctionOrMethod(boxRTFunction((void*)disable, NONE, 0)));
gc_module->giveAttr("enable", new BoxedBuiltinFunctionOrMethod(boxRTFunction((void*)enable, NONE, 0)));
......
......@@ -1721,7 +1721,7 @@ public:
BoxedString* s;
std::string::const_iterator it, end;
BoxedStringIterator(BoxedString* s) : it(s->s.begin()), end(s->s.end()) {}
BoxedStringIterator(BoxedString* s) : s(s), it(s->s.begin()), end(s->s.end()) {}
DEFAULT_CLASS(str_iterator_cls);
......
......@@ -116,3 +116,7 @@ test_just_funcs("abcde", 5)
test_just_funcs("abcde", 6)
test_just_funcs("abcde", 7)
test_just_funcs("abcde", 8)
import gc
for c in "hello world":
gc.collect()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment