码迷,mamicode.com
首页 > 移动开发 > 详细

CSAPP 书附带的代码中找不到的 config.h 在此给出(坑爹啊。。。)

时间:2014-07-28 15:43:03      阅读:620      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   os   io   2014   for   cti   

原本是在实现malloc的过程中要有个#include "config.h"

但是怎么找都找不到,只要google,还好有好心人给出了config.h

不然我怎么都不明白HEAP_MAX究竟是多少。。。。


#ifndef __CONFIG_H_
#define __CONFIG_H_

/*
* config.h - malloc lab configuration file
*
* Copyright (c) 2002, R. Bryant and D. O'Hallaron, All rights reserved.
* May not be used, modified, or copied without permission.
*/

/*
* Config variables for submitting autoresults to the Autolab server
* Note: The COURSE and LAB variables must match the directory names
* on the Autolab server.
*/

/*
* This is the default path where the driver will look for the
* default tracefiles. You can override it at runtime with the -t flag.
*/
#define TRACEDIR "./traces/"

/*
* This is the list of default tracefiles in TRACEDIR that the driver
* will use for testing. Modify this if you want to add or delete
* traces from the driver's test suite.
*
* The first four test correctness. The last several test utilization
* and performance.
*/
#define DEFAULT_TRACEFILES "alaska.rep", "amptjp.rep", "bash.rep", "boat.rep","cccp.rep", "chrome.rep", "coalesce-big.rep", "coalescing-bal.rep", "corners.rep", "cp-decl.rep", "exhaust.rep", "firefox.rep", "firefox-reddit.rep", "hostname.rep", "login.rep", "lrucd.rep", "ls.rep", "malloc.rep", "malloc-free.rep", "needle.rep", "nlydf.rep", "perl.rep", "qyqyc.rep", "random.rep", "random2.rep", "rm.rep", "rulsr.rep","seglist.rep", "short2.rep"

/*
* If this is uncommented, then use "alt grading", in which
* final_score = min(util_score, perf_score), which prevents
* an unbalanced allocator from getting a good score. Alt
* grading ignores UTIL_WEIGHT, as both util and perf are graded
* on a scale from 0 to 100.
*/
//#define ALT_GRADING


/*
* Students get 0 points for this point or below (ops / sec)
*/
#define MIN_SPEED 3000E3


/*
* Students get 0 points for this allocation fraction or below
*/
#define MIN_SPACE 0.60


/*
* Students can get more points for building faster allocators, up to
* this point (in ops / sec)
*/
#define MAX_SPEED 13750E3

/*
* Students can get more points for building more efficient allocators,
* up to this point (1 is perfect).
*/
#define MAX_SPACE 0.91

 /*
* This constant determines the contributions of space utilization
* (UTIL_WEIGHT) and throughput (1 - UTIL_WEIGHT) to the performance
* index.
*/

#define UTIL_WEIGHT .61

/*
* Alignment requirement in bytes (either 4 or 8)
*/
#define ALIGNMENT 8

/*
* Maximum heap size in bytes
*/
#define MAX_HEAP (100*(1<<20)) /* 100 MB */

/*****************************************************************************
* Set exactly one of these USE_xxx constants to "1" to select a timing method
*****************************************************************************/
#define USE_FCYC 1 /* cycle counter w/K-best scheme (x86 & Alpha only) */
#define USE_ITIMER 0 /* interval timer (any Unix box) */
#define USE_GETTOD 0 /* gettimeofday (any Unix box) */

#endif /* __CONFIG_H */






神人 Hallaron

bubuko.com,布布扣




CSAPP 书附带的代码中找不到的 config.h 在此给出(坑爹啊。。。),布布扣,bubuko.com

CSAPP 书附带的代码中找不到的 config.h 在此给出(坑爹啊。。。)

标签:style   blog   http   os   io   2014   for   cti   

原文地址:http://blog.csdn.net/cinmyheart/article/details/38230977

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!