summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-09-10 17:50:02 +0200
committerMyles Borins <mylesborins@google.com>2017-11-14 13:57:30 -0500
commit4aec8cfcd23abbb0d7be172d63a2dbed1e31fb61 (patch)
treed6d62db53cea87dedcd9bec0bc9061dd6d413fa7 /src/tls_wrap.cc
parent19f3ac9749f80b3cab9d4248d6784dffbdf1a368 (diff)
downloadnode-new-4aec8cfcd23abbb0d7be172d63a2dbed1e31fb61.tar.gz
src: pass desired return type to allocators
Pass the desired return type directly to the allocation functions, so that the resulting `static_cast` from `void*` becomes unneccessary and the return type can be use as a reasonable default value for the `size` parameter. Backport-PR-URL: https://github.com/nodejs/node/pull/16587 PR-URL: https://github.com/nodejs/node/pull/8482 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 1f1e1eeb2d..4b8a575d56 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -663,7 +663,7 @@ void TLSWrap::OnDestructImpl(void* ctx) {
void TLSWrap::OnAllocSelf(size_t suggested_size, uv_buf_t* buf, void* ctx) {
- buf->base = static_cast<char*>(node::Malloc(suggested_size));
+ buf->base = node::Malloc(suggested_size);
CHECK_NE(buf->base, nullptr);
buf->len = suggested_size;
}