intmain() { int *p0 = sbrk(0); // 打印堆地址 printf("this site of p0 is : %d\n", p0);
int *p1 = sbrk(1000); // 这里仍然打印的是第一次的堆地址 printf("this site of p1 is : %d\n", p1); int *p2 = sbrk(1); // 打印第一次堆地址+1000后的地址 printf("this site of p2 is : %d\n", p2); // 回到初始堆地址,释放空间 sbrk(-1001); int *p3 = sbrk(0); // 检查是否回到初始地址 printf("this site of p3 is : %d\n", p3); }
输出如下内容: this site of p0 is : 264622080 this site of p1 is : 264622080 this site of p2 is : 264623080 this site of p3 is : 264622080
intmain() { int *p0 = sbrk(0); printf("this site of p0 is : %d\n", p0); brk(p0 + 1000); printf("this site is : %d\n", sbrk(0)); brk(p0 + 1001); printf("this site is : %d\n", sbrk(0)); brk(p0); printf("this site is : %d\n", sbrk(0)); }
函数输出如下: this site of p0 is : 206979072 this site is : 206983072 this site is : 206983076 this site is : 206979072
# The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. dataDir=/home/hadoop/zookeeper-3.3.2/zookeeper_data # the port at which the clients will connect clientPort=2181 dataLogDir=/home/hadoop/zookeeper-3.3.2/logs server.1=192.168.20.6:2888:3888 server.2=192.168.20.36:2888:3888 server.3=192.168.20.38:2888:3888