摘要: 原文地址:http://www.cnblogs.com/mydomain/archive/2011/08/14/2138454.html 线程的分离与结合 在任何一个时间点上,线程是可结合的(joinable),或者是分离的(detached)。一个可结合的线程能够被其他线程收回其资源和杀死;在被其 阅读全文
posted @ 2016-04-23 22:10 xey_csu 阅读(248) 评论(0) 推荐(0) 编辑
摘要: One of the problems with developing embedded systems is the detection of memory leaks; I've found three tools that are useful for this. These tools ar 阅读全文
posted @ 2016-04-16 23:58 xey_csu 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://www.linuxjournal.com/article/6556?page=0,0 An earlier article [“Memory Leak Detection in Embedded Systems”, LJ, September 2002, available 阅读全文
posted @ 2016-04-16 23:54 xey_csu 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 以下测试基于的gcc版本: gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4Copyright (C) 2013 Free Software Foundation, Inc.This is free software; see the source for copyin 阅读全文
posted @ 2016-04-16 22:14 xey_csu 阅读(3845) 评论(0) 推荐(1) 编辑
摘要: leveldb中自己实现了一个简单的单元测试工具,下面是一个对CRC类测试的一个例子class CRC { };TEST(CRC, Extend) { ASSERT_EQ(Value("hello world", 11), Extend(Value("hello ", 6), "world"... 阅读全文
posted @ 2016-01-21 22:32 xey_csu 阅读(599) 评论(0) 推荐(0) 编辑
摘要: #smbpasswd -a user_name (user_name为系统中在在的用户名)编辑/etc/samba/smb.conf[xxxx]path=/home/xxxread only = nopublic = novalid users = user_namecreate mode = 06... 阅读全文
posted @ 2016-01-17 20:01 xey_csu 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 在阿里云买了个云服务器,内存1G。编译kudu时出现下面的错误:virtual memory exhausted: Cannot allocate memory问题原因:由于物理内存本身很小,且阿里云服务器并没有分配swap空间,当物理内存不够用时, 物理内存中暂时不用的内容没地方转存。... 阅读全文
posted @ 2016-01-16 18:46 xey_csu 阅读(1834) 评论(0) 推荐(0) 编辑
摘要: 一直以来没分清什么时候该使用assert,什么时候该使用if。现在将其记录下来assert 用于检查参数的合法性以及某个预期的结果等,assert只在debug模式中在在。assert是面向程序员的,而不是面向用户,主要方便程序员能够检查及快速定位程序的逻辑错误(程序员自身带来的问题),如果在调试程... 阅读全文
posted @ 2015-12-20 13:02 xey_csu 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 为什么要使用inline函数?对于频繁被调用的小函数来说,每次调用都要保存当前寄存器,传递参数,以及结果后恢复之前的状态需要一定的开销。如果将其声明为inline,则在调用处会直接对其展开,由于函数较小,所以并不会对生成的二进制文件太大。将函数返回类型加上关键字inline就将函数指定为inline... 阅读全文
posted @ 2015-12-20 12:40 xey_csu 阅读(631) 评论(0) 推荐(0) 编辑
摘要: leveldb中实现了一个简单的内存管理工具Arena,其基本思想为:先预先向系统申请一块内存,此后需要申请内存时,直接到预先分配的内存中申请。那么这样做的目的是什么呢?(1)避免了频率地进行malloc/new和free/delete操作,同时对于内存管理变得简单,对于内存的释放工作交给Arena... 阅读全文
posted @ 2015-12-20 11:54 xey_csu 阅读(791) 评论(0) 推荐(0) 编辑