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
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-04-05 08:37:06 +0400
committerRyan Dahl <ry@tinyclouds.org>2010-04-05 08:37:08 +0400
commit85487c82d0bc187398b0168d1ac9607f51e76867 (patch)
treeac6c0288b381c33a740bb386e92d5f323332d53e /src/node_buffer.h
parent01f7d4484e5aa079155c0affc35210eee6959f99 (diff)
Blob struct should not contain actual data
This is to allow eventual realloc without messing up the data_ references in all the slices.
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r--src/node_buffer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h
index e746cdebe18..24ead8701a5 100644
--- a/src/node_buffer.h
+++ b/src/node_buffer.h
@@ -37,7 +37,7 @@ class Buffer : public ObjectWrap {
return constructor_template->HasInstance(obj);
}
- const char* data() const { return data_; }
+ char* data();
size_t length() const { return length_; }
struct Blob_* blob() const { return blob_; }
@@ -63,8 +63,8 @@ class Buffer : public ObjectWrap {
Buffer(Buffer *parent, size_t start, size_t end);
~Buffer();
- const char *data_;
- size_t length_;
+ size_t off_; // offset inside blob_
+ size_t length_; // length inside blob_
struct Blob_ *blob_;
};