diff options
author | Anna Henningsen <anna@addaleax.net> | 2016-09-10 17:50:02 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2016-09-29 09:46:42 +0200 |
commit | 48ed65440ca33fe6063d92379b3a9b10b65e98e9 (patch) | |
tree | b0fbfa17238c7d00839b92f3712e39c468c77c0a /src/tls_wrap.cc | |
parent | eb927fac38a50252e11ebe0da1764e85294f95f0 (diff) | |
download | android-node-v8-48ed65440ca33fe6063d92379b3a9b10b65e98e9.tar.gz android-node-v8-48ed65440ca33fe6063d92379b3a9b10b65e98e9.tar.bz2 android-node-v8-48ed65440ca33fe6063d92379b3a9b10b65e98e9.zip |
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.
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.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index d1b1aeccdd..dbe6677516 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -661,7 +661,7 @@ void TLSWrap::OnReadImpl(ssize_t nread, 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; } |