astobj2_private.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * astobj2 - replacement containers for asterisk data structures.
  3. *
  4. * Copyright (C) 2006 Marta Carbone, Luigi Rizzo - Univ. di Pisa, Italy
  5. *
  6. * See http://www.asterisk.org for more information about
  7. * the Asterisk project. Please do not directly contact
  8. * any of the maintainers of this project for assistance;
  9. * the project provides a web site, mailing lists and IRC
  10. * channels for your use.
  11. *
  12. * This program is free software, distributed under the terms of
  13. * the GNU General Public License Version 2. See the LICENSE file
  14. * at the top of the source tree.
  15. */
  16. /*! \file
  17. *
  18. * \brief Common, private definitions for astobj2.
  19. *
  20. * \author Richard Mudgett <rmudgett@digium.com>
  21. */
  22. #ifndef ASTOBJ2_PRIVATE_H_
  23. #define ASTOBJ2_PRIVATE_H_
  24. #include "asterisk/astobj2.h"
  25. #if defined(AO2_DEBUG)
  26. #define AO2_DEVMODE_STAT(stat) stat
  27. #else
  28. #define AO2_DEVMODE_STAT(stat)
  29. #endif /* defined(AO2_DEBUG) */
  30. #ifdef AO2_DEBUG
  31. struct ao2_stats {
  32. volatile int total_objects;
  33. volatile int total_mem;
  34. volatile int total_containers;
  35. volatile int total_refs;
  36. volatile int total_locked;
  37. };
  38. extern struct ao2_stats ao2;
  39. #endif /* defined(AO2_DEBUG) */
  40. int is_ao2_object(void *user_data);
  41. enum ao2_lock_req __adjust_lock(void *user_data, enum ao2_lock_req lock_how, int keep_stronger);
  42. #endif /* ASTOBJ2_PRIVATE_H_ */