这是一个本人学习 csapp 的 learning 库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.3 KiB

2 years ago
  1. #ifndef __CONFIG_H_
  2. #define __CONFIG_H_
  3. /*
  4. * config.h - malloc lab configuration file
  5. *
  6. * Copyright (c) 2002, R. Bryant and D. O'Hallaron, All rights reserved.
  7. * May not be used, modified, or copied without permission.
  8. */
  9. /*
  10. * This is the default path where the driver will look for the
  11. * default tracefiles. You can override it at runtime with the -t flag.
  12. */
  13. #define TRACEDIR "/afs/cs/project/ics2/im/labs/malloclab/traces/"
  14. /*
  15. * This is the list of default tracefiles in TRACEDIR that the driver
  16. * will use for testing. Modify this if you want to add or delete
  17. * traces from the driver's test suite. For example, if you don't want
  18. * your students to implement realloc, you can delete the last two
  19. * traces.
  20. */
  21. #define DEFAULT_TRACEFILES \
  22. "amptjp-bal.rep",\
  23. "cccp-bal.rep",\
  24. "cp-decl-bal.rep",\
  25. "expr-bal.rep",\
  26. "coalescing-bal.rep",\
  27. "random-bal.rep",\
  28. "random2-bal.rep",\
  29. "binary-bal.rep",\
  30. "binary2-bal.rep",\
  31. "realloc-bal.rep",\
  32. "realloc2-bal.rep"
  33. /*
  34. * This constant gives the estimated performance of the libc malloc
  35. * package using our traces on some reference system, typically the
  36. * same kind of system the students use. Its purpose is to cap the
  37. * contribution of throughput to the performance index. Once the
  38. * students surpass the AVG_LIBC_THRUPUT, they get no further benefit
  39. * to their score. This deters students from building extremely fast,
  40. * but extremely stupid malloc packages.
  41. */
  42. #define AVG_LIBC_THRUPUT 600E3 /* 600 Kops/sec */
  43. /*
  44. * This constant determines the contributions of space utilization
  45. * (UTIL_WEIGHT) and throughput (1 - UTIL_WEIGHT) to the performance
  46. * index.
  47. */
  48. #define UTIL_WEIGHT .60
  49. /*
  50. * Alignment requirement in bytes (either 4 or 8)
  51. */
  52. #define ALIGNMENT 8
  53. /*
  54. * Maximum heap size in bytes
  55. */
  56. #define MAX_HEAP (20*(1<<20)) /* 20 MB */
  57. /*****************************************************************************
  58. * Set exactly one of these USE_xxx constants to "1" to select a timing method
  59. *****************************************************************************/
  60. #define USE_FCYC 0 /* cycle counter w/K-best scheme (x86 & Alpha only) */
  61. #define USE_ITIMER 0 /* interval timer (any Unix box) */
  62. #define USE_GETTOD 1 /* gettimeofday (any Unix box) */
  63. #endif /* __CONFIG_H */