summaryrefslogtreecommitdiffstats
path: root/src/Buffer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-09-13 20:51:22 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-09-13 20:51:22 +0200
commitd567ceb9306f8250a28e0b68cc4ca9d196deef75 (patch)
treebb4d474c109167d225f6ebf18bbe966b80730b26 /src/Buffer.cpp
parent984680904368b94a64f45c6e5aa27348cf3d299d (diff)
downloaddabmod-d567ceb9306f8250a28e0b68cc4ca9d196deef75.tar.gz
dabmod-d567ceb9306f8250a28e0b68cc4ca9d196deef75.tar.bz2
dabmod-d567ceb9306f8250a28e0b68cc4ca9d196deef75.zip
Add some Buffer comments
Diffstat (limited to 'src/Buffer.cpp')
-rw-r--r--src/Buffer.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 7cbbe57..dff2623 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -73,8 +73,10 @@ void Buffer::setLength(size_t len)
/* Align to 32-byte boundary for AVX. */
data = memalign(32, len);
- memcpy(data, tmp, this->len);
- free(tmp);
+ if (tmp != NULL) {
+ memcpy(data, tmp, this->len);
+ free(tmp);
+ }
size = len;
}
this->len = len;
@@ -97,14 +99,3 @@ void Buffer::appendData(const void *data, size_t len)
}
}
-
-size_t Buffer::getLength()
-{
- return len;
-}
-
-
-void *Buffer::getData()
-{
- return data;
-}