Index: src/extensions/gc-extension.h |
diff --git a/src/extensions/gc-extension.h b/src/extensions/gc-extension.h |
index 8c25e7d84d5e286b763d22873ca1d7962d1a9cce..adc79fe3398b3a8e5c2cc486bb6f68b74f923492 100644 |
--- a/src/extensions/gc-extension.h |
+++ b/src/extensions/gc-extension.h |
@@ -35,12 +35,21 @@ namespace internal { |
class GCExtension : public v8::Extension { |
public: |
- explicit GCExtension(const char* source) : v8::Extension("v8/gc", source) {} |
+ explicit GCExtension(const char* fun_name) |
+ : v8::Extension("v8/gc", |
+ BuildSource(buffer_, sizeof(buffer_), fun_name)) {} |
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
v8::Isolate* isolate, |
v8::Handle<v8::String> name); |
static void GC(const v8::FunctionCallbackInfo<v8::Value>& args); |
- static void Register(); |
+ |
+ private: |
+ static const char* BuildSource(char* buf, size_t size, const char* fun_name) { |
+ OS::SNPrintF(Vector<char>(buf, size), "native function %s();", fun_name); |
+ return buf; |
+ } |
+ |
+ char buffer_[50]; |
}; |
} } // namespace v8::internal |