GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: update Buffer.allocUnsafe description · nodejs/node@11918d7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • buffer.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+3-4Lines changed: 3 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,9 @@ A `TypeError` will be thrown if `size` is not a number.
807807

808808
The `Buffer` module pre-allocates an internal `Buffer` instance of
809809
size [`Buffer.poolSize`][] that is used as a pool for the fast allocation of new
810-
`Buffer` instances created using [`Buffer.allocUnsafe()`][],
811-
[`Buffer.from(array)`][], [`Buffer.concat()`][], and the deprecated
812-
`new Buffer(size)` constructor only when `size` is less than or equal
813-
to `Buffer.poolSize >> 1` (floor of [`Buffer.poolSize`][] divided by two).
810+
`Buffer` instances created using [`Buffer.allocUnsafe()`][], [`Buffer.from(array)`][],
811+
and [`Buffer.concat()`][] only when `size` is less than or equal to
812+
`Buffer.poolSize >> 1` (floor of [`Buffer.poolSize`][] divided by two).
814813

815814
Use of this pre-allocated internal memory pool is a key difference between
816815
calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.