提交 b474effc authored 作者: Frederic's avatar Frederic

Fix a bug in the VM/CVM GC that was the default in the trunk since the 5 July 2012.

This can cause wrong results with some combination of inplace op. Otherwise, it make stuff slower.
上级 c6e02ef2
......@@ -771,7 +771,8 @@ int lazy_rec_eval(CLazyLinker * self, Py_ssize_t var_idx, PyObject*one, PyObject
Py_INCREF(Py_None);
err = PyList_SetItem(self->var_value_cells[i_idx], 0, Py_None);
self->var_computed[i_idx] = 0;
//See the Stack gc implementation for why we change it to 2 and not 0.
self->var_computed[i_idx] = 2;
if (err) goto fail;
}
}
......@@ -972,7 +973,7 @@ static PyTypeObject lazylinker_ext_CLazyLinkerType = {
static PyObject * get_version(PyObject *dummy, PyObject *args)
{
PyObject *result = PyFloat_FromDouble(0.17);
PyObject *result = PyFloat_FromDouble(0.18);
return result;
}
......
......@@ -13,7 +13,7 @@ if config.compiledir not in sys.path:
sys.path.append(config.compiledir)
force_compile = False
version = 0.17 # must match constant returned in function get_version()
version = 0.18 # must match constant returned in function get_version()
try:
......
......@@ -369,7 +369,14 @@ class Stack(VM):
if all(compute_map[v][0]
for v in dependencies[i]):
storage_map[i][0] = None
compute_map[i][0] = 0
#DO NOT set compute_map to 0
#If values become False and the
#current_apply is still in the
#stack, this will cause it to be
#recomputed! This can cause wrong value
#with some combiation of inplace op.
compute_map[i][0] = 2
elif not computed_ins:
# -- Non-lazy case, need inputs
apply_stack.append(current_apply)
......@@ -429,7 +436,9 @@ class Stack(VM):
break
if empty_storage_map:
storage_map[i][0] = None
compute_map[i][0] = None
#See the not lazy gc code for explanations
#Of compute_map change
compute_map[i][0] = 2
# Hacky coarse gc final pass
# This is required until we have a proper gc algorithm for graphs with
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论