From 2ccaa44f2f0928d162bd09a673314d300555626d Mon Sep 17 00:00:00 2001 From: "jiangfriend@gmail.com" Date: Tue, 14 Feb 2012 21:42:53 +0800 Subject: [PATCH] clean code --- src/node-curl.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/node-curl.h b/src/node-curl.h index ee3c20a..41112f7 100644 --- a/src/node-curl.h +++ b/src/node-curl.h @@ -10,13 +10,12 @@ #include #include -#define NODE_CURL_OPTION_NX(name, value) {#name, value} -#define NODE_CURL_OPTION(name) NODE_CURL_OPTION_NX(name , CURLOPT_##name) #define NODE_CURL_EXPORT(name) export_curl_options(t, #name, name, sizeof(name) / sizeof(CurlOption)); class NodeCurl { - struct CurlOption { + struct CurlOption + { const char *name; int value; }; @@ -31,11 +30,11 @@ class NodeCurl v8::Persistent handle; bool in_curlm; std::vector slists; + NodeCurl(v8::Handle object) : in_curlm(false) { ++count; - // I know 2*4096 is magical world, but I have no idea the real memory curl will occupied v8::V8::AdjustAmountOfExternalAllocatedMemory(2*4096); object->SetPointerInInternalField(0, this); handle = v8::Persistent::New(object);