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
path: root/tools
diff options
context:
space:
mode:
authorTom Hughes <tom.hughes@palm.com>2011-03-08 09:00:51 +0300
committerRyan Dahl <ry@tinyclouds.org>2011-03-09 00:56:41 +0300
commit74954ce7d8b4b734302d295d0c816f04a694254e (patch)
tree75b61a90a05d4950c89e78a1a362cb4df4bf33f5 /tools
parent81d3de7e6db6abe36ac907d8f0fa6dfc01f7bbcd (diff)
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.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/js2c.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/js2c.py b/tools/js2c.py
index 8ef644ee190..fd8b25b1a4e 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -53,7 +53,7 @@ def ToCArray(filename, lines):
value = ord(chr)
- if value > 128:
+ if value >= 128:
print 'non-ascii value ' + filename + ':' + str(row) + ':' + str(col)
sys.exit(1);
@@ -220,6 +220,7 @@ namespace node {
struct _native {
const char* name;
const char* source;
+ size_t source_len;
};
static const struct _native natives[] = {
@@ -236,7 +237,7 @@ static const struct _native natives[] = {
NATIVE_DECLARATION = """\
- { "%(id)s", %(id)s_native },
+ { "%(id)s", %(id)s_native, sizeof(%(id)s_native)-1 },
"""
SOURCE_DECLARATION = """\