def __init__(self, *, slot_bytes, slot_count):
"""Initializer.
Args:
slot_bytes: How big each buffer in the array should be.
slot_count: How many buffers should be in the array.
"""
self.slot_bytes = slot_bytes
self.slot_count = slot_count
self.length_bytes = 4
slot_type = ctypes.c_byte * (slot_bytes + self.length_bytes)
self.array = multiprocessing.RawArray(slot_type, slot_count)
评论列表
文章目录