上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 38 下一页
摘要: 1. typedef int (*GET_VIDEO_FLAG_CALLBACK)(void* param); typedef struct { volatile int8_t pm_lock_ref; pthread_mutex_t pm_lock_mutex; pthread_t pm_task 阅读全文
posted @ 2022-09-29 17:16 一个不知道干嘛的小萌新 阅读(65) 评论(0) 推荐(0)
摘要: 查看当前环境变量: 查看当前环境变量: echo $PATH 或 env 设置环境变量的三种方法:1.临时设置 export PATH=/tmp:$PATH //在原有的PATH路径前面新增/tmp目录 $PATH:/tmp表示在原有路径后面增加/tmp目录 export LD_LIBRARY_PA 阅读全文
posted @ 2022-09-19 17:18 一个不知道干嘛的小萌新 阅读(120) 评论(0) 推荐(0)
摘要: gain表示增益,即放大倍数,一般多用于硬件放大器,随着gain值增大会带入相应的噪声。 模拟增益(analog_gain)带来的噪声 用数据来说明:2.4 和3.1,数字量化后为2和3.但假如模拟增益2x,则为4.8和6.2,量化后为5和6。这就是模拟增益带来的噪声。但模拟增益带来的噪声只会一次引 阅读全文
posted @ 2022-09-17 16:11 一个不知道干嘛的小萌新 阅读(2732) 评论(0) 推荐(0)
摘要: 内存泄露的几种原因: 动态内存分配未释放:使用 malloc、calloc、realloc 或 new(C++)分配内存后,未调用对应的 free 或 delete 释放。 文件描述符或资源泄漏:打开文件、套接字、设备驱动等资源后未关闭,间接导致内核内存泄漏。 缓存或数据结构未清理:动态构建的链表、 阅读全文
posted @ 2022-09-16 10:41 一个不知道干嘛的小萌新 阅读(97) 评论(0) 推荐(0)
摘要: 在对缓冲区(一般为数组)进行拷贝前,要保证复制的长度不要超过缓冲区的空间大小。比如在 memcpy 前,要检查目的地址是否有足够的空间。 使用宏或 sizeof 可保证缓冲长度的一致性: char dst_buf[64]; memcpy(dst_buf, src_buf,64) 当缓冲大小改变为 3 阅读全文
posted @ 2022-09-15 19:13 一个不知道干嘛的小萌新 阅读(224) 评论(0) 推荐(0)
摘要: 1.动态库 1.1 生成一个动态库: #include <stdlib.h> #include <stdio.h> void dynamic_lib_call(void) { printf("dynamic lib call\n"); } 编译: gcc -Wall -shared dlib.c - 阅读全文
posted @ 2022-09-15 11:13 一个不知道干嘛的小萌新 阅读(257) 评论(0) 推荐(0)
摘要: 这些 Linux 程序调试工具,可以看到程序内部的很多小秘密 - 知乎 (zhihu.com) (37条消息) (九)GDBdebug调试技术——backtrace无法正确显示(栈破坏)_喜欢打篮球的普通人的博客-CSDN博客 阅读全文
posted @ 2022-09-14 14:53 一个不知道干嘛的小萌新 阅读(46) 评论(0) 推荐(0)
摘要: 每一次系统调用的 read 和 write 成功返回后,文件的偏移量都会被更新。 因此,如果程序对同一个文件描述符进行读写操作的话,肯定会得到非期望的结果,示例代码如下: #include <stdio.h> #include <stdlib.h> #include <string.h> int m 阅读全文
posted @ 2022-06-24 15:33 一个不知道干嘛的小萌新 阅读(427) 评论(0) 推荐(0)
摘要: 1.demo.c #include <stdlib.h> #include <stdio.h> #include <unistd.h> int main(void) { int cnt = 0; int fd = 0; char name[64]; while (1) { snprintf(name 阅读全文
posted @ 2022-06-14 20:22 一个不知道干嘛的小萌新 阅读(196) 评论(0) 推荐(0)
摘要: 链接:https://www.zhihu.com/question/19732473/answer/241673170 IO 概念区分 四个相关概念: 同步(Synchronous) 异步( Asynchronous) 阻塞( Blocking ) 非阻塞( Nonblocking) 这四个概念的含 阅读全文
posted @ 2022-05-26 20:46 一个不知道干嘛的小萌新 阅读(94) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 38 下一页