summaryrefslogtreecommitdiff
path: root/lib/Buffer.cc
diff options
context:
space:
mode:
authorpixel <pixel>2008-01-21 17:55:43 +0000
committerpixel <pixel>2008-01-21 17:55:43 +0000
commitb0f465417a0b64053a00b3353cc7b03eca3c444d (patch)
tree8f18201724abf633b56d63081467552a56b663fa /lib/Buffer.cc
parent18a3133823522b7d0454b59e48e9c066f5d15d1e (diff)
Adding even more debug stats.
Diffstat (limited to 'lib/Buffer.cc')
-rw-r--r--lib/Buffer.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Buffer.cc b/lib/Buffer.cc
index 7def194..74e8cda 100644
--- a/lib/Buffer.cc
+++ b/lib/Buffer.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Buffer.cc,v 1.29 2007-09-17 08:33:25 pixel Exp $ */
+/* $Id: Buffer.cc,v 1.30 2008-01-21 17:55:43 pixel Exp $ */
#include <string.h>
#ifdef HAVE_CONFIG_H
@@ -26,15 +26,25 @@
#include "Buffer.h"
#include "generic.h"
-Buffer::Buffer(bool _seekable) : Handle(-1), buffer(0), zero(0), realsiz(0), bufsiz(0), ptr(0), wptr(0), seekable(_seekable), got_eof(false) { }
+int Buffer::nb_buffer = 0;
+
+int Buffer::GetNbBuffer() {
+ return nb_buffer;
+}
+
+Buffer::Buffer(bool _seekable) : Handle(-1), buffer(0), zero(0), realsiz(0), bufsiz(0), ptr(0), wptr(0), seekable(_seekable), got_eof(false) {
+ nb_buffer++;
+}
Buffer::~Buffer() {
free(buffer);
+ nb_buffer--;
}
Buffer::Buffer(const Buffer & b) : Handle(-1), buffer(0), zero(b.zero), realsiz(b.realsiz), bufsiz(b.bufsiz), ptr(b.ptr), wptr(b.wptr), seekable(b.seekable), got_eof(b.got_eof) {
buffer = (Byte *) malloc(bufsiz);
memcpy(buffer, b.buffer, bufsiz);
+ nb_buffer++;
}
ssize_t Buffer::write(const void *buf, size_t count) throw (GeneralException) {