08 2013 档案

摘要:在Emacs的手册16.1节中有这样一句话,Any command other than an undo command breaks the sequence of undo commands. Starting from that moment, the entire sequence of undo commands that you have just performed are themselves placed into the undo record, as a single set of changes. Therefore, to re-apply changes you h 阅读全文
posted @ 2013-08-29 21:29 WendellYih 阅读(2750) 评论(0) 推荐(0) 编辑
摘要:#include #include typedef void* element_t;struct stack_node_t { element_t data; struct stack_node_t* prev; // 指向前一个元素,方向是向栈底};struct stack_t { struct stack_node_t* base; struct stack_node_t* top; int size;};int stack_init(struct stack_t* s) { assert(NUL... 阅读全文
posted @ 2013-08-25 23:07 WendellYih 阅读(277) 评论(0) 推荐(0) 编辑
摘要:1.定义 指针:在K&R C上的原文为“A pointer is a group of cell (often two or four) that can hold an address.” 从概念上看,指针是包含地址的变量。 数组:能存储连续固定数量的相同类型元素的数据结构。2.指针数组和数组指针int *arr_for_p[5]; // 指针数组int (*p_for_arr)[5]; // 数组指针由于[]的优先级高于*,所以第一条语句可以写成这样int* (arr_for_p[5]);而第二条语句的解释可以理解为(*p_for_arr)代表了一个5个整数的数组,而p... 阅读全文
posted @ 2013-08-08 15:20 WendellYih 阅读(243) 评论(0) 推荐(0) 编辑
摘要:由于内核使用写时复制机制,fork之后父子进程是共享页表描述符的,如果让父进程先执行,那么有很大几率父进程会修改共享页表指向的数据,那么内核此时必须给父进程分配并复制新的页表供父进程修改使用,那么如果子进程被创建之后什么都没干后退出了,那么这个写时复制就是多余的。如果让子进程先执行,如果子进程什么都没做就退出了,那么就没有什么所谓的写时复制了,避免了不必要的页面复制。另外如果子进程确实运行了新的程序(我们的shell程序基本上是如此),那谁先谁后就无所谓了。 阅读全文
posted @ 2013-08-04 13:45 WendellYih 阅读(1708) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示