- 浏览: 1448511 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
原文地址http://blog.163.com/james_huangjian/blog/static/178049345201261643452479/
eflag寄存器
http://www.cnblogs.com/shenlian/archive/2011/05/22/2053857.html
eflag寄存器
http://www.cnblogs.com/shenlian/archive/2011/05/22/2053857.html
intptr_t 其实不是指针类型 2012-07-16 16:34:52| 分类: C++ |字号 订阅 intptr_t 其实不是指针类型 分类: C语言 2012-04-23 17:26 336人阅读 评论(0) 收藏 举报 最近在看nginx源码,看到有一个类型intptr_t,没有见过,google了一下,有人说是指针类型,但是看nginx源码中对该类型变量的使用,好像不是指针类型。 [cpp] view plaincopy static ngx_int_t 667 ngx_get_options(int argc, char *const *argv) 668 { 669 u_char *p; 670 ngx_int_t i; 671 672 for (i = 1; i < argc; i++) { 673 674 p = (u_char *) argv[i]; 675 676 if (*p++ != '-') { 677 ngx_log_stderr(0, "invalid option: \"%s\"", argv[i]); 678 return NGX_ERROR; 679 } 680 681 while (*p) { 682 683 switch (*p++) { 684 685 case '?': 686 case 'h': 687 ngx_show_version = 1; 688 ngx_show_help = 1; 689 break; 其中ngx_int_t的定义如下: [cpp] view plaincopy 78 typedef intptr_t ngx_int_t; 于是在linux的头文件中查找这个类型的定义,在/usr/include/stdint.h这个头文件中找到了这个类型的定义(不知道怎么在这里插入图片,所以使用文字): [cpp] view plaincopy 117 /* Types for `void *' pointers. */ 118 #if __WORDSIZE == 64 119 # ifndef __intptr_t_defined 120 typedef long int intptr_t; 121 # define __intptr_t_defined 122 # endif 123 typedef unsigned long int uintptr_t; 124 #else 125 # ifndef __intptr_t_defined 126 typedef int intptr_t; 127 # define __intptr_t_defined 128 # endif 129 typedef unsigned int uintptr_t; 130 #endif 很明显intptr_t不是指针类型,但是上边的一句注释(/* Types for `void *' pointers. */)让人很疑惑。既然不是指针类型,但是为什么说类型是为了“void *”指针? 又查了一下在《深入分析Linux内核源码》中找到了答案,原文描述如下: 尽管在混合不同数据类型时你必须小心, 有时有很好的理由这样做. 一种情况是因为内存存取, 与内核相关时是特殊的. 概念上, 尽管地址是指针, 内存管理常常使用一个无符号的整数类型更好地完成; 内核对待物理内存如同一个大数组, 并且内存地址只是一个数组索引. 进一步地, 一个指针容易解引用; 当直接处理内存存取时, 你几乎从不想以这种方式解引用
发表评论
-
xl2tp 备份
2019-09-24 16:25 5812019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 692sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1406参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 18192019年12月26日 可以参考原来的配置 https:// ... -
consul的基本使用
2017-06-27 11:13 1359### 安装 [centos7上consul的安装](ht ... -
lvs的helloworld
2017-06-13 20:36 566###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 567《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1926参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 917/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 550找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1765上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 953不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4264假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 652764位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1683转 原文链接: http://www.wenquan.name ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1559接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1495qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ... -
neutron基础七(qemu tap)
2016-02-02 17:02 977使用qemu 建立个虚拟机 然后用tap设备, 根据基础六,t ... -
neutron基础六(bridge fdb)
2016-01-28 18:30 2149转发表 在三台机器上建立三个namespace 192.16 ... -
南北流量
2016-01-23 23:26 1773一、三层网络架构: 接入层:负责服务器的接入和隔离 汇聚层:汇 ...
相关推荐
intptr_t MsgQueue_PostMsg(msg_queue_t * pMsgQueue, const uint16_t msgId, const uintptr_t param); intptr_t MsgQueue_PostDelayedMsg(msg_queue_t * pMsgQueue, const uint16_t msgId, const uintptr_t param,...
intptr_t uintptr_t Integer type capable of holding a value converted from a void pointer and then be converted back to that type with a value that compares equal to the original pointer. Optional: ...
C#中的IntPtr类型称为“平台特定的整数类型”,它们用于本机资源,如窗口句柄。 资源的大小取决于使用的硬件和操作系统,但其大小总是足以包含系统的指针(因此也可以包含资源的名称)。 例如,我们可以在vs2008...
public static libvlc_media_player_t Create_MediaPlayer(libvlc_instance_t libvlc_instance, IntPtr handle) { libvlc_media_player_t libvlc_media_player = IntPtr.Zero; try { if (libvlc_instance == ...
extern public static IntPtr libvlc_new(int argc, IntPtr argv); //创建播放器实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_...
extern public static IntPtr libvlc_new(int argc, IntPtr argv); //创建播放器实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_...
验证码识别利器 private const string OCR_DLL_... IntPtr ptr; ptr = com_asprise_ocr_recognize(_handle.ToInt64(), Application.StartupPath + "\\yzm.bmp", -1, -1, -1, -1, -1, "all", "text", "", "|", "=");
public static extern IntPtr com_asprise_ocr_recognize(Int64 handle, string imgFiles, int pageIndex, int startX, int startY, int width, int height, string recognizeType, string outputFormat, string ...
std:: intptr_t section_offset, section_addr; std::string section_name; std::string section_type; int section_size, section_ent_size, section_addr_align;} section_t ; 使用elf解析器获取elf节# include ...
internal static extern libvlc_media_t libvlc_media_new_location(libvlc_instance_t libvlc_instance, IntPtr path); //从本地文件路径构建一个libvlc_media [DllImport("libvlc", CallingConvention...
Nginx_study编写说明本次学习二进制分为多个阶段第一阶段:完成逐步架构,基本功能,各模块能独立运行阶段一1.1封装整形intptr_t长度总是所在平台的数字,32位系统为4字节,64位系统为8字节1.2数据结构 ngy_buf_t是...
private IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam) 还有个线路,用MessageWindow 在ce上不直接覆盖虚函数,ce的msgloop更新到MessageWindow 独立类里,需要自己写个类,挂这个类到窗体...
intptr_t hand = _findfirst( "E:\\source\\repos\\trace\\Debug\\*.tlog", &fileinfo; ); if( hand == -1 ) { return; } files.push_back( fileinfo.name ); while( _findnext( hand, &fileinfo; ) == 0 ) ...
闪烁应用程序窗体,不用timer控件,C#源代码[DllImport("User32")] public static extern bool FlashWindow(IntPtr hWnd, bool bInvert); try { int MyTimes = 50; int MyTime = 50; for (int MyCount = 0; ...
Only Chinese document is ...intptr_t 非算术基本类型 - 文本型 e::system::string 字节集 e::system::bin 日期时间型 e::system::datetime 子程序指针 e::system::methodptr 通用型 e::system::any 高级类型 -
public delegate uint DMC3K5K_OPERATE(IntPtr operate_data); public partial class DmcFunc { //设置和读取打印模式(适用于所有脉冲/总线卡) [DllImport("LTDMC.dll", EntryPoint = "dmc_set_debug_mode", ...
private static extern IntPtr SimReadRecord(IntPtr hSim, IntPtr dwAddress, IntPtr dwRecordType, IntPtr dwIndex, byte[] lpData, IntPtr dwBufferSize, ref IntPtr lpdwBytesRead); [DllImport("cellcore....
本文实例讲述了C#判断本地文件是否处于打开状态的方法。分享给大家供大家参考。具体分析如下: ... private static extern IntPtr _lopen(string lpPathName, int iReadWrite); [DllImport(kernel32.dll
public enum VideoStandard_t : uint { /// /// 无视频信号 /// StandardNone = 0x80000000, /// /// NTSC制式 /// StandardNTSC = 0x00000001, /// /// PAL制式 /// StandardPAL = 0x00000002,...
static extern IntPtr SendMessage(IntPtr Handle, Int32 msg, IntPtr wParam, IntPtr lParam); const Int32 LVM_FIRST = 0x1000; // List messages const Int32 LVM_GETHEADER = LVM_FIRST + 31; const Int32...