会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wa小怪兽
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2021年3月8日
Nginx main()源码分析
摘要: 1 int ngx_cdecl 2 main(int argc, char *const *argv) 3 { 4 ngx_buf_t *b; 5 ngx_log_t *log; 6 ngx_uint_t i; 7 ngx_cycle_t *cycle, init_cycle; 8 ngx_conf
阅读全文
posted @ 2021-03-08 11:39 wa小怪兽
阅读(156)
评论(0)
推荐(0)
2021年3月7日
K个一组翻转链表
摘要: 面试的时候居然写炸了。补一下 1 #include <iostream> 2 3 using namespace std; 4 5 struct ListNode { 6 int val; 7 ListNode *next; 8 ListNode() : val(0), next(nullptr)
阅读全文
posted @ 2021-03-07 18:03 wa小怪兽
阅读(51)
评论(0)
推荐(0)
2021年2月20日
Ubuntu16.04安装qt creator
摘要: 安装qt相关库: sudo apt install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default 安装qt-creater: sudo apt install qtcreator 添加环
阅读全文
posted @ 2021-02-20 17:42 wa小怪兽
阅读(265)
评论(0)
推荐(0)
2021年2月4日
C++迭代器模式封装多叉树
摘要: 多叉树存储的方式: 采用链表的方式维护子节点,每个结点的child指针指向子节点链表的首节点。通过next指针即可遍历子节点链表。 采用迭代器模式的设计思路,封装了多叉树dfs遍历接口:iterator_node以及bfs遍历接口:iterator_leval_node。 iterator_node
阅读全文
posted @ 2021-02-04 19:31 wa小怪兽
阅读(350)
评论(0)
推荐(0)
2021年1月20日
字符串移动m位
摘要: 面试问了这道题,居然没想出最优解,记录下。 #include <iostream> #include <cstring> using namespace std; void str_turn (char *str, int len) { for (int i = 0; i < len/2; i++)
阅读全文
posted @ 2021-01-20 11:14 wa小怪兽
阅读(153)
评论(0)
推荐(0)
2021年1月11日
Linux源码 list.h解析
摘要: Linux源码中include/linux/list.h封装了双向链表的数据结构。 网上实现双向链表的方式大抵相同,都是定义一个struct Node表示链表的节点,Node结构体包含指向节点数据的指针,和指向节点的next和pre指针: 1 struct Node { 2 void *data;
阅读全文
posted @ 2021-01-11 23:20 wa小怪兽
阅读(951)
评论(0)
推荐(0)
2020年11月2日
C++ RTTI
摘要: C++通过以下两个运算符进行运行时类型识别: 1. typeid 查询类型的信息 在使用typeid前需要包含typeinfo头文件。 #include <typeinfo> 当typeid查询多态类型表达式时,将会有虚表查找的开销,查询其他表达式在编译前即完成。 可以通过typeinfo::nam
阅读全文
posted @ 2020-11-02 19:35 wa小怪兽
阅读(130)
评论(0)
推荐(0)
2020年10月26日
flamegraph(火焰图)性能分析
摘要:
使用perf工具以及flamegraph将调试的程序运行栈以及在每个函数中停留的时间以火焰图的形式展现出来,以可视化的方式进行调试。
阅读全文
posted @ 2020-10-26 11:59 wa小怪兽
阅读(862)
评论(0)
推荐(0)
2020年10月15日
wall time和monotonic time
摘要: 在一些系统调用中需要指定时间是用CLOCK_MONOTONIC还是CLOCK_REALTIME。 CLOCK_MONOTONIC是monotonic time,而CLOCK_REALTIME是wall time。 monotonic time字面意思是单调时间,实际上它指的是系统启动以后流逝的时间,
阅读全文
posted @ 2020-10-15 14:51 wa小怪兽
阅读(562)
评论(0)
推荐(0)
2020年9月27日
ngx_os_init解析
摘要: 1 ngx_int_t 2 ngx_os_init(ngx_log_t *log) 3 { 4 ngx_time_t *tp; 5 ngx_uint_t n; 6 #if (NGX_HAVE_LEVEL1_DCACHE_LINESIZE) 7 long size; 8 #endif 9 10 #if
阅读全文
posted @ 2020-09-27 21:18 wa小怪兽
阅读(274)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告