We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5334345 commit 2b71a65Copy full SHA for 2b71a65
lib/internal/fixed_queue.js
@@ -49,6 +49,11 @@ const kMask = kSize - 1;
49
// | undefined | | item |
50
// +-----------+ +-----------+
51
//
52
+// Implementation detail: To reduce allocations, a single spare
53
+// FixedCircularBuffer may be kept for reuse. When a segment empties it is
54
+// reset and stored as the spare, and when the head fills the spare is linked
55
+// in. This does not change the active list structure or queue semantics.
56
+//
57
// Adding a value means moving `top` forward by one, removing means
58
// moving `bottom` forward by one. After reaching the end, the queue
59
// wraps around.
0 commit comments