Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "buffer/alloc-unsafe/docs/types/index.d"

Index

Functions

Functions

Export assignment allocUnsafe

  • allocUnsafe(size: number): Buffer
  • Allocates a buffer having a specified number of bytes.

    Notes

    • The underlying memory of returned Buffer instances is not initialized. Memory contents are unknown and may contain sensitive data.
    • When the size is less than half the pool size (specified on the Buffer constructor), memory is allocated from the Buffer pool for faster allocation of new Buffer instances.
    throws

    must provide a nonnegative integer

    Parameters

    • size: number

      number of bytes to allocate

    Returns Buffer

    new Buffer instance

    Example

    var buf = allocUnsafe( 10 );
    // returns <Buffer>