diff options
Diffstat (limited to 'lib/Buffer.cc')
-rw-r--r-- | lib/Buffer.cc | 14 |
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) { |