mirror of
https://github.com/wassname/ray.git
synced 2026-08-06 13:31:10 +08:00
Fix stack overflow if many objects are fetched. (#237)
* fix stack overflow if many objects are fetched * fix other stack allocations * add tests and fix linting * address stephanie's comments * fix linting * fix tests
This commit is contained in:
committed by
Robert Nishihara
parent
e5a9fc0032
commit
ca254b8689
@@ -320,8 +320,8 @@ static PyObject* retrieve_list(PyObject* self, PyObject* args) {
|
||||
if (!PyObjectToPlasmaConnection(plasma_conn, &conn)) { return NULL; }
|
||||
|
||||
Py_ssize_t num_object_ids = PyList_Size(object_id_list);
|
||||
object_id object_ids[num_object_ids];
|
||||
object_buffer object_buffers[num_object_ids];
|
||||
object_id* object_ids = new object_id[num_object_ids];
|
||||
object_buffer* object_buffers = new object_buffer[num_object_ids];
|
||||
|
||||
for (int i = 0; i < num_object_ids; ++i) {
|
||||
PyStringToUniqueID(PyList_GetItem(object_id_list, i), &object_ids[i]);
|
||||
@@ -374,6 +374,9 @@ static PyObject* retrieve_list(PyObject* self, PyObject* args) {
|
||||
PyList_SetItem(returns, i, t);
|
||||
}
|
||||
|
||||
delete[] object_ids;
|
||||
delete[] object_buffers;
|
||||
|
||||
return returns;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user