Files
node-v0.x-archive/src/node_string.cc
Tom Hughes 74954ce7d8 Add string class that uses ExternalAsciiStringResource.
Change the natives to use this class instead of creating completely new
strings. Reduces memory usage by about 1 MB.
2011-03-08 13:56:41 -08:00

19 lines
334 B
C++

#include "node_string.h"
namespace node {
using namespace v8;
Handle<String> ImmutableAsciiSource::CreateFromLiteral(
const char *string_literal,
size_t length) {
HandleScope scope;
Local<String> ret = String::NewExternal(new ImmutableAsciiSource(
string_literal,
length));
return scope.Close(ret);
}
}