MCPcopy Index your code
hub / github.com/nodejs/node / computeNewHighWaterMark

Function computeNewHighWaterMark

lib/internal/streams/readable.js:620–635  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

618// Don't raise the hwm > 1GB.
619const MAX_HWM = 0x40000000;
620function computeNewHighWaterMark(n) {
621 if (n > MAX_HWM) {
622 throw new ERR_OUT_OF_RANGE('size', '<= 1GiB', n);
623 } else {
624 // Get the next highest power of 2 to prevent increasing hwm excessively in
625 // tiny amounts.
626 n--;
627 n |= n >>> 1;
628 n |= n >>> 2;
629 n |= n >>> 4;
630 n |= n >>> 8;
631 n |= n >>> 16;
632 n++;
633 }
634 return n;
635}
636
637// This function is designed to be inlinable, so please take care when making
638// changes to the function body.

Callers 1

readable.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…