Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

private_set_alloc_checking.h
Go to the documentation of this file.
1 // $Header$
2 //
3 // Copyright (C) 2000 - 2004, by
4 //
5 // Carlo Wood, Run on IRC <carlo@alinoe.com>
6 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
7 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
8 //
9 // This file may be distributed under the terms of the Q Public License
10 // version 1.0 as appearing in the file LICENSE.QPL included in the
11 // packaging of this file.
12 //
13 
18 #ifndef LIBCWD_PRIVATE_SET_ALLOC_CHECKING_H
19 #define LIBCWD_PRIVATE_SET_ALLOC_CHECKING_H
20 
21 #ifndef LIBCWD_CONFIG_H
22 #include "config.h"
23 #endif
24 #ifndef LIBCWD_PRIVATE_STRUCT_TSD_H
25 #include "private_struct_TSD.h"
26 #endif
27 
28 namespace libcwd {
29  namespace _private_ {
30 
31 #if CWDEBUG_ALLOC
32 #if CWDEBUG_DEBUGM
33  extern void set_alloc_checking_off(LIBCWD_TSD_PARAM);
34  extern void set_alloc_checking_on(LIBCWD_TSD_PARAM);
35  extern int set_library_call_on(LIBCWD_TSD_PARAM);
36  extern void set_library_call_off(int saved_internal LIBCWD_COMMA_TSD_PARAM);
37 #else
38  inline void set_alloc_checking_off(LIBCWD_TSD_PARAM) { ++__libcwd_tsd.internal; }
39  inline void set_alloc_checking_on(LIBCWD_TSD_PARAM) { --__libcwd_tsd.internal; }
40  inline int set_library_call_on(LIBCWD_TSD_PARAM)
41  {
42  int internal_saved = __libcwd_tsd.internal;
43  __libcwd_tsd.internal = 0;
44  ++__libcwd_tsd.library_call;
45  return internal_saved;
46  }
47  inline void set_library_call_off(int saved_internal LIBCWD_COMMA_TSD_PARAM)
48  {
49  __libcwd_tsd.internal = saved_internal;
50  --__libcwd_tsd.library_call;
51  }
52 #endif
53  inline void set_invisible_on(LIBCWD_TSD_PARAM) { ++__libcwd_tsd.invisible; }
54  inline void set_invisible_off(LIBCWD_TSD_PARAM) { --__libcwd_tsd.invisible; }
55 #else // !CWDEBUG_ALLOC
56  inline void set_alloc_checking_off(LIBCWD_TSD_PARAM_UNUSED) { }
57  inline void set_alloc_checking_on(LIBCWD_TSD_PARAM_UNUSED) { }
58  inline int set_library_call_on(LIBCWD_TSD_PARAM_UNUSED) { return 0; }
59  inline void set_library_call_off(int LIBCWD_COMMA_TSD_PARAM_UNUSED) { }
60  inline void set_invisible_on(LIBCWD_TSD_PARAM_UNUSED) { }
61  inline void set_invisible_off(LIBCWD_TSD_PARAM_UNUSED) { }
62 #endif // !CWDEBUG_ALLOC
63 
64  } // namespace _private_
65 } // namespace libcwd
66 
67 #endif // LIBCWD_PRIVATE_SET_ALLOC_CHECKING_H
namespace for libcwd.
Definition: debug.cc:87
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.