summaryrefslogtreecommitdiff
path: root/lib/internal/freelist.js
AgeCommit message (Collapse)Author
2019-12-03http: remove unused hasItems() from freelistRich Trott
Remove the hasItems() method from freelist module as it is unused internally. PR-URL: https://github.com/nodejs/node/pull/30744 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Weijia Wang <starkwang@126.com>
2019-11-25lib: flatten access to primordialsMichaël Zasso
Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-04-11lib: faster FreeListAnatoli Papirovski
Make FreeList faster by using Reflect.apply and not using is_reused_symbol, but rather just checking whether any items are present in the list prior to calling alloc. PR-URL: https://github.com/nodejs/node/pull/27021 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-10async_hooks: add missing async_hooks destroys in AsyncResetBastian Krol
This adds missing async_hooks destroy calls for sockets (in _http_agent.js) and HTTP parsers. We need to emit a destroy in AsyncWrap#AsyncReset before assigning a new async_id when the instance has already been in use and is being recycled, because in that case, we have already emitted an init for the "old" async_id. This also removes a duplicated init call for HTTP parser: Each time a new parser was created, AsyncReset was being called via the C++ Parser class constructor (super constructor AsyncWrap) and also via Parser::Reinitialize. PR-URL: https://github.com/nodejs/node/pull/23272 Fixes: https://github.com/nodejs/node/issues/19859 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-17lib: update indentation of ternariesRich Trott
In preparation for stricter indentation linting and to increase code clarity, update indentation for ternaries in lib. PR-URL: https://github.com/nodejs/node/pull/14247 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-01freelist: simplify exportJames M Snell
PR-URL: https://github.com/nodejs/node/pull/12644 Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-22lib: refactor internal/freelistJames M Snell
PR-URL: https://github.com/nodejs/node/pull/11406 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2016-03-02lib: freelist: use .pop() for allocationAnton Khlynovskiy
Array#pop() is known to be faster than Array#shift(). To be exact, it's O(1) vs. O(n). In this case there's no difference from which side of the "pool" array the object is retrieved, so .pop() should be preferred. PR-URL: https://github.com/nodejs/node/pull/2174 Reviewed-By: mscdex - Brian White <mscdex@mscdex.net> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
2015-03-25iojs: introduce internal modulesVladimir Kurchatkin
Internal modules can be used to share private code between public modules without risk to expose private APIs to the user. PR-URL: https://github.com/iojs/io.js/pull/848 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>