Skip to content

Commit

Permalink
Use memoryview in serialized cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Retribution98 committed Dec 13, 2023
1 parent c058065 commit 9619120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unidist/core/backends/mpi/core/local_object_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def cache_serialized_data(self, data_id, data):
# We make a copy to avoid data corruption obtained through out-of-band serialization,
# and buffers are marked read-only to prevent them from being modified.
# `to_bytes()` call handles both points.
data["raw_buffers"] = [buf.tobytes() for buf in data["raw_buffers"]]
data["raw_buffers"] = [memoryview(buf.tobytes()) for buf in data["raw_buffers"]]
self._serialization_cache[data_id] = data
self.maybe_update_data_id_map(data_id)

Expand Down

0 comments on commit 9619120

Please sign in to comment.