代码改变世界

[转] Policies/Binary Compatibility Issues With C++

2011-03-15 11:11 by zhenjing, 735 阅读, 0 推荐, 收藏, 编辑
摘要:C/C++ 的二进制兼容性 (binary compatibility)与ABI (application binary interface)关系甚大。到底如何判断一个改动是不是二进制兼容呢?这跟 C++ 的实现方式直接相关,虽然 C++ 标准没有规定 C++ 的 ABI,但是几乎所有主流平台都有明文或事实上的 ABI 标准。C++ ABI 的主要内容: * 函数参数传递的方式,比如 x86-64 用寄存器来传函数的前 4 个整数参数 * 虚函数的调用方式,通常是 vptr/vtbl 然后用 vtbl[offset] 来调用 * struct 和 class 的内存布局,通过偏移量来访问数据成员 * name mangling * RTTI 和异常处理的实现(以下本文不考虑异常处理) C/C++ 通过头文件暴露出动态库的使用方法,这个“使用方法”主要是给编译器看的,编译器会据此生成二进制代码,然后在运行的时候通过装载器(loader)把可执行文件和动态库绑到一起。如何判断一个改动是不是二进制兼容,主要就是看头文件暴露的这份“使 阅读全文

SQL批量删除与批量插入

2011-03-11 12:03 by zhenjing, 79768 阅读, 1 推荐, 收藏, 编辑
摘要:SQL批量删除与批量插入 阅读全文

[转] SQL和C数据类型的映射

2011-03-03 17:01 by zhenjing, 3213 阅读, 0 推荐, 收藏, 编辑
摘要:SQL Data Type 和 SQL和C数据类型的映射 阅读全文

[转] Buffer Overflows and You (下)

2011-03-03 11:59 by zhenjing, 809 阅读, 0 推荐, 收藏, 编辑
摘要:Got root?Gentlemen, we can root it. We have the technology. We have the capability to root yet another poor idiot's server on the int4rw3bs. Steve Austin will be that man. Better than he was before. Better, stronger, faster, errrr...We spent all that time developing a small bit of shellcode. Let 阅读全文

[转] Buffer Overflows and You (上)

2011-03-03 11:48 by zhenjing, 787 阅读, 0 推荐, 收藏, 编辑
摘要:Magical gnomes present: Buffer Overflows and You Is it the 90's? Are you wondering why your server is running slow? Why it's trying to ping flood some host in California? Why someone else is logged into your machine and you've recently become a prominent porn hosting provider? This site will help you figure it all out. And if you have a time machine, you can probably go back and do it to someone else! Before continuing, it's important to note that this guide is designed for 64-bit systems. 阅读全文

[转] my.cnf 配置选项

2011-02-25 15:40 by zhenjing, 315 阅读, 0 推荐, 收藏, 编辑
摘要:本文中的配置都是从《MySQL5权威指南(3rd)》中摘抄出来的,个人认为对于使用MySQL十分有用。放在此处方便自己随时查阅,也希望对其他朋友有所助益。 阅读全文

MySQL Transactions, Part III - BDB Tables, Table locking and Savepoints

2011-02-15 13:05 by zhenjing, 525 阅读, 0 推荐, 收藏, 编辑
摘要:MySQL Transactions, Part III - BDB Tables, Table locking and Savepoints 阅读全文

MySQL Transactions, Part II - Transaction Isolation Levels

2011-02-15 11:51 by zhenjing, 973 阅读, 0 推荐, 收藏, 编辑
摘要:MySQL Transactions, Part II - Transaction Isolation Levels 阅读全文

Transactions in MySQL

2011-02-15 10:49 by zhenjing, 660 阅读, 1 推荐, 收藏, 编辑
摘要:Transactions-in-MySQL 阅读全文

[C++再学习系列] stl::string与二进制数据

2011-01-30 14:14 by zhenjing, 9295 阅读, 0 推荐, 收藏, 编辑
摘要:C99有很多和string相关的函数,如 strcat,strchr,strcmp,strcpy,strlen,strncat,strncmp,strncpy等。然而使用C++编程时,所有和string相关的操作均可以使用string类的相关接口完成,string提供和原来C接口类似的功能和性能,同时提供更高的安全性。 String类有一个特性:a string of length n must manage a block of memory whose size is at least n + 1。即长度为n的string对象,其内存空间至少为n+1个字符,且最后一个字符为’\0’。不过在进行string操作时,有一点必须牢记:C/C++语言的string是以’\0’结尾的,对不以’\0’结尾的string进行操作容易引发错误,甚至导致内存溢出等crash。 C++的string类,除了用于处理常规string操作外,其本身也可用于存储各种数据,如文件数据。使用者采用string( const char* str, size_type 阅读全文
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页