mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Change the natives to use this class instead of creating completely new strings. Reduces memory usage by about 1 MB.
19 lines
334 B
C++
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);
|
|
}
|
|
|
|
}
|