Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer: use dynamic buffer pool #30661

Closed
wants to merge 4 commits into from

Commits on Nov 26, 2019

  1. buffer: use internal allocate function instead of public one

    This makes sure that `Buffer.concat` does not use exposed functions
    that might have been tampered with. Instead, it uses the direct
    call to the internal `allocate` function and skipps the size check.
    BridgeAR committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    01329e9 View commit details
    Browse the repository at this point in the history
  2. buffer: only validate if necessary

    This moves a validation check and removes another one that is done
    twice. The validation is obsolete in case of `Buffer.concat`. For
    `Buffer.copy` only one check is required (one side is already
    guaranteed to be an instance of buffer).
    BridgeAR committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    8328a35 View commit details
    Browse the repository at this point in the history
  3. test: harden test/parallel/test-zlib-unused-weak.js

    This makes sure the buffer pool size is taken into account while
    checking for the GC overhead. It would otherwise indicate a faulty
    result.
    BridgeAR committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    be33e66 View commit details
    Browse the repository at this point in the history
  4. buffer: use a dynamic pool size instead of a fixed one

    This significantly improves the performance in case lots of smallish
    buffers are used. In case they are frequently allocated, the pool
    will increase to a size of up to 2 MB. It starts with no pool and is
    therefore smaller by default than the current default. That way it's
    better for devices that have hard memory constraints.
    BridgeAR committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    e783973 View commit details
    Browse the repository at this point in the history