mirror of https://github.com/Jittor/Jittor
polish py_ring_buffer
This commit is contained in:
parent
efcb32b1e1
commit
7ebf3e8ee4
|
@ -8,7 +8,7 @@
|
|||
# This file is subject to the terms and conditions defined in
|
||||
# file 'LICENSE.txt', which is part of this source code package.
|
||||
# ***************************************************************
|
||||
__version__ = '1.2.2.15'
|
||||
__version__ = '1.2.2.16'
|
||||
from . import lock
|
||||
with lock.lock_scope():
|
||||
ori_int = int
|
||||
|
|
|
@ -170,8 +170,8 @@ static PyObject* pop_py_object(RingBuffer* rb, uint64& __restrict__ offset, bool
|
|||
auto size = rb->pop_t<int64>(offset);
|
||||
PyObjHolder dict(PyDict_New());
|
||||
for (int64 i=0; i<size; i++) {
|
||||
PyObject* key = pop_py_object(rb, offset, keep_numpy_array);
|
||||
PyObject* value = pop_py_object(rb, offset, keep_numpy_array);
|
||||
PyObjHolder key(pop_py_object(rb, offset, keep_numpy_array));
|
||||
PyObjHolder value(pop_py_object(rb, offset, keep_numpy_array));
|
||||
PyDict_SetItem(dict.obj, key, value);
|
||||
}
|
||||
return dict.release();
|
||||
|
|
Loading…
Reference in New Issue