Function bufferAlignedAllocShared

  • Creates a new buffer backed by a SharedArrayBuffer with the given size and alignment. If alignment is not specified, the default alignment of 32 is used. The buffer does not come from the nodejs buffer pool, it is allocated using aligned_malloc.

    Is the same as Buffer.alloc but is aligned and uses a SharedArrayBuffer as storage. We need an aligned buffer to create a roaring bitmap frozen view.

    Parameters

    • size: number

      The size of the buffer to allocate.

    • Optionalalignment: number

      The alignment of the buffer to allocate.

    Returns Buffer