Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

48 linhas
1.1 KiB

  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * Copyright (c) 2009 Sam Hocevar <sam@hocevar.net>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. /*
  14. * This file contains profiling functions.
  15. */
  16. #ifndef __CACA_PROF_H__
  17. #define __CACA_PROF_H__
  18. #if defined PROF && !defined __KERNEL__
  19. # define PROFILING_VARS
  20. # define STAT_IADD(s, n) \
  21. do \
  22. { \
  23. struct caca_stat *ss = s; \
  24. int ii, nn = n; \
  25. for (ii = STAT_VALUES - 1; ii > 0; ii--) \
  26. ss->itable[ii] = ss->itable[ii - 1]; \
  27. ss->itable[0] = nn; \
  28. ss->imean = ((int64_t)ss->imean * 15 + nn) / 16; \
  29. } \
  30. while(0)
  31. # define START_PROF(obj, fn)
  32. # define STOP_PROF(obj, fn)
  33. #else
  34. # define PROFILING_VARS
  35. # define STAT_IADD(s) do { } while(0)
  36. # define START_PROF(obj, fn) do { } while(0)
  37. # define STOP_PROF(obj, fn) do { } while(0)
  38. #endif
  39. #endif /* __CACA_PROF_H__ */