三、注册PMEM设备这里我们除了描述PMEM设备,还将注册一个拥有memory空间和IRQ资源的示例设备example_device。对于example_device,定义如下结构体:static struct resource example_resources[] = {[0] = {.star...
分类:
移动开发 时间:
2014-07-09 19:38:37
阅读次数:
182
旧事重提了,或许很多人会奇怪,为什么 C# 不允许lock一个struct ? 例如:public void ProcessTask(int taskid){ lock(taskid){ ..... }}编译说lock只能使用引用类型。有些人聪明(我想我以前也有这样的"聪明"。。),这样做: loc...
分类:
其他好文 时间:
2014-07-09 17:28:13
阅读次数:
191
内存管理的管理范围任何继承了NSObject的对象对其他非对象类型无效(int、char、float、double、struct、enum等 )只有OC对象才需要进行内存管理的本质原因:OC对象存放于堆里面非OC对象一般放在栈里面(栈内存会被系统自动回收)系统是如何判断 什么时候需要回收一个对象所占...
分类:
其他好文 时间:
2014-07-09 14:22:54
阅读次数:
190
参考资料:红黑树我的实现 1 #define BLACK 1 2 #define RED 0 3 4 struct node 5 { 6 int value; 7 node *left, *right, *parent; 8 bool color; 9 ...
分类:
其他好文 时间:
2014-07-09 13:37:56
阅读次数:
144
不同的操作系统对应不同的事件驱动机制,在Linux 2.6之后使用epoll机制,对应的事件驱动模块是ngx_epoll_module。Nginx的ngx_event_core_module模块根据操作系统确定使用哪一个事件驱动模块。事件驱动模块在ngx_module_t的ctx通用接口是ngx_event_module_t,定义如下所示:
typedef struct {
ngx_st...
分类:
其他好文 时间:
2014-07-09 12:01:13
阅读次数:
230
1、支持win和unix服务器环境,遵循Apache2开源协议。
2、借鉴struct架构,MVC设计模式等
3.几个重要概念:
Dao:DataAccessObject(数据访问对象)
VO对象:ValueObject(数据对象,或者是业务对象)
VoList对象:ThinkPHP数据操作的基本元素。
4、分层架构:...
分类:
Web程序 时间:
2014-07-09 10:08:11
阅读次数:
247
glusterfs中的内存管理方式: 1 struct mem_pool * 2 mem_pool_new_fn (unsigned long sizeof_type, 3 unsigned long count, char *name) 4 { 5 ...
分类:
其他好文 时间:
2014-07-08 21:50:47
阅读次数:
441
线段树应用:
有一个数列,初始时为 a1,a2,… aN (N
1) 将 ai 的值加上 val ;
2) 对于一个区间[l,r],该区间的和。
3) 对于一个区间[l,r],求该区间的最大值。
数据结构:
//Node Type
struct Node{
int left, right;
int max, sum;
} tree[maxn];
/*
tree[k]'...
分类:
其他好文 时间:
2014-07-08 21:31:33
阅读次数:
237
1.先序遍历非递归算法
#define maxsize 100
typedef struct {
Bitree Elem[maxsize];
int top;
} SqStack;
void PreOrderUnrec(Bitree t) {
SqStack s;
StackInit(s);
p=t;
while (p!=...
分类:
其他好文 时间:
2014-07-08 17:13:18
阅读次数:
267
2014.7.8fb#include using namespace std;struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int val) { left = NUL...
分类:
其他好文 时间:
2014-07-08 11:50:56
阅读次数:
147