Last change
on this file since 12756 was 10673, checked in by Michael Tänzer, 12 years ago |
Merge bugfix into trunk: Fix intialisation of static variable. Only relevant
when compiling in debug mode
|
File size:
840 bytes
|
Line | |
---|
1 | //-----------------------------------------------------------------------------
|
---|
2 | // Part of reboost (http://reboost.org). Released under the
|
---|
3 | // BSD 2-clause license (http://www.opensource.org/licenses/bsd-license.php).
|
---|
4 | // Copyright 2012, Sebastian Mies <mies@reboost.org> --- All rights reserved.
|
---|
5 | //-----------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | #include "shared_buffer.hpp"
|
---|
8 | #include <iostream>
|
---|
9 |
|
---|
10 | namespace reboost {
|
---|
11 |
|
---|
12 | using namespace std;
|
---|
13 |
|
---|
14 | #ifdef DEBUG
|
---|
15 |
|
---|
16 | void shared_buffer_t::onexit() {
|
---|
17 | if (allocated_buffers != 0)
|
---|
18 | cerr << "shared_buffer_t: " << allocated_buffers << " leaked buffers." << endl;
|
---|
19 | }
|
---|
20 |
|
---|
21 | size_t shared_buffer_t::init() {
|
---|
22 | atexit(&shared_buffer_t::onexit);
|
---|
23 | return 0;
|
---|
24 | }
|
---|
25 |
|
---|
26 | size_t shared_buffer_t::allocated_buffers = init();
|
---|
27 | boost::mutex shared_buffer_t::allocated_buffers_mutex;
|
---|
28 |
|
---|
29 | #endif //DEBUG
|
---|
30 |
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.