summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-12-23 00:23:50 -0800
committerJosh Blum2012-12-23 00:23:50 -0800
commit0a0ec3568a0c0e907df157df891a4e683dc6d264 (patch)
treed31a0c4bb46d6ca4e328f7e5051a225189fb58b6
parentf32f981624c01005fe23af855b143a36ca052690 (diff)
downloadsandhi-0a0ec3568a0c0e907df157df891a4e683dc6d264.tar.gz
sandhi-0a0ec3568a0c0e907df157df891a4e683dc6d264.tar.bz2
sandhi-0a0ec3568a0c0e907df157df891a4e683dc6d264.zip
added user driven last ptr for sbuffer stitching
-rw-r--r--include/gras/detail/sbuffer.hpp3
-rw-r--r--include/gras/sbuffer.hpp3
-rw-r--r--lib/sbuffer.cpp1
3 files changed, 6 insertions, 1 deletions
diff --git a/include/gras/detail/sbuffer.hpp b/include/gras/detail/sbuffer.hpp
index c3dab6b..0d68ebc 100644
--- a/include/gras/detail/sbuffer.hpp
+++ b/include/gras/detail/sbuffer.hpp
@@ -39,7 +39,8 @@ GRAS_FORCE_INLINE void intrusive_ptr_release(SBufferImpl *impl)
GRAS_FORCE_INLINE SBuffer::SBuffer(void):
offset(0),
- length(0)
+ length(0),
+ last(NULL)
{
//NOP
}
diff --git a/include/gras/sbuffer.hpp b/include/gras/sbuffer.hpp
index b82aff1..2d63e50 100644
--- a/include/gras/sbuffer.hpp
+++ b/include/gras/sbuffer.hpp
@@ -116,6 +116,9 @@ struct GRAS_API SBuffer : boost::intrusive_ptr<SBufferImpl>
//! The number of valid bytes past offset
size_t length;
+ //! Pointer to the end of the last buffer
+ void *last;
+
//! Get the affinity of the memory
long get_affinity(void) const;
diff --git a/lib/sbuffer.cpp b/lib/sbuffer.cpp
index c1f3b75..03f87b1 100644
--- a/lib/sbuffer.cpp
+++ b/lib/sbuffer.cpp
@@ -34,6 +34,7 @@ SBufferConfig::SBufferConfig(void)
memory = NULL;
length = 0;
affinity = -1;
+ user_index = ~0;
}
static void numa_mem_deleter(SBuffer &buff)