暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132
  1. export = pool;
  2. /**
  3. * An allocator as used by {@link util.pool}.
  4. * @typedef PoolAllocator
  5. * @type {function}
  6. * @param {number} size Buffer size
  7. * @returns {Uint8Array} Buffer
  8. */
  9. type PoolAllocator = (size: number) => Uint8Array;
  10. /**
  11. * A slicer as used by {@link util.pool}.
  12. * @typedef PoolSlicer
  13. * @type {function}
  14. * @param {number} start Start offset
  15. * @param {number} end End offset
  16. * @returns {Uint8Array} Buffer slice
  17. * @this {Uint8Array}
  18. */
  19. type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;
  20. /**
  21. * A general purpose buffer pool.
  22. * @memberof util
  23. * @function
  24. * @param {PoolAllocator} alloc Allocator
  25. * @param {PoolSlicer} slice Slicer
  26. * @param {number} [size=8192] Slab size
  27. * @returns {PoolAllocator} Pooled allocator
  28. */
  29. declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;