• Ken MacKay's avatar
    [Chromecast] Create buffer pool for IOBuffers · 7c800e5d
    Ken MacKay authored
    IOBufferPool is a class that allocates fixed-size IOBuffers. There is
    an optional limit on the maximum number of buffers that will be allocated.
    Buffers from the pool can be used as usual; when they are deleted, the memory
    will be returned to the pool to be reused. Buffers can be safely used and
    freed even after the IOBufferPool instance is destroyed.
    
    IOBufferPool is optionally threadsafe (defaults to non-threadsafe). When
    thread safety is enabled, the pool and allocated buffers can be used from
    any sequence. If thread safety is not enabled, the pool and buffers may only
    be used from the sequence that created IOBufferPool.
    
    Change-Id: I901c70bbb0f7dca1395886246209e0aeb6805151
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1805866
    Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
    Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
    Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#697012}
    7c800e5d
io_buffer_pool.cc 6.73 KB