Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2015-06-01 21:29:17 +0300
committerRod Vagg <rod@vagg.org>2015-08-04 21:56:10 +0300
commitd75f5c8d0ecdf400933b601ed07b064dbfe27bf6 (patch)
treedf5c51cda5e900e89993926aeb79161e2d3c3eee /src/node_buffer.h
parent63da0dfd3a4460e117240e84b57af2137469497e (diff)
buffer: finish implementing FreeCallback
Passing a FreeCallback to Buffer::New() now uses externalized ArrayBuffer's. PR-URL: https://github.com/nodejs/io.js/pull/1825 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r--src/node_buffer.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h
index 4b1b2cd8591..568b68f83db 100644
--- a/src/node_buffer.h
+++ b/src/node_buffer.h
@@ -14,6 +14,8 @@ namespace Buffer {
static const unsigned int kMaxLength = smalloc::kMaxLength;
+NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint);
+
NODE_EXTERN bool HasInstance(v8::Handle<v8::Value> val);
NODE_EXTERN bool HasInstance(v8::Handle<v8::Object> val);
NODE_EXTERN char* Data(v8::Handle<v8::Value> val);
@@ -49,12 +51,12 @@ NODE_DEPRECATED("Use New(isolate, ...)",
NODE_EXTERN v8::Local<v8::Object> New(v8::Isolate* isolate,
char* data,
size_t length,
- smalloc::FreeCallback callback,
+ FreeCallback callback,
void* hint);
NODE_DEPRECATED("Use New(isolate, ...)",
inline v8::Local<v8::Object> New(char* data,
size_t length,
- smalloc::FreeCallback callback,
+ FreeCallback callback,
void* hint) {
return New(v8::Isolate::GetCurrent(), data, length, callback, hint);
})
@@ -93,7 +95,7 @@ v8::Local<v8::Object> New(Environment* env, const char* data, size_t len);
v8::Local<v8::Object> New(Environment* env,
char* data,
size_t length,
- smalloc::FreeCallback callback,
+ FreeCallback callback,
void* hint);
v8::Local<v8::Object> Use(Environment* env, char* data, size_t length);
#endif // defined(NODE_WANT_INTERNALS)