objcopy
摘要:objcopyobjcopy [options]infile[outfile]Copy the contents of the input object file to another file, optionally changing the file format in the process (but not the endian-ness). Ifoutfileis not specified,objcopycreates a temporary file and renames it toinfilewhen the copy is complete, destroying the
阅读全文
posted @
2013-12-21 11:16
Rosepotato
阅读(516)
推荐(0)
C++ volatile的作用
摘要:volatile的作用 2006-10-23 13:44:21 大 中 小 关键在于两个地方: 1. 编译器的优化 (请高手帮我看看下面的理解)在本次线程内, 当读取一个变量时,为提高存取速度,编译器优化时有时会先把变量读取到一个寄存器中;以后,再取变量值时,就直接从寄存器中取值;当变量值在本线程里改变时,会同时把变量的新值copy到该寄存器中,以便保持一致当变量在因别的线程等而改变了值,该寄存器的值不会相应改变,从而造成应用程序读取的值和实际的变量值不一致当该寄存器在因别的线程等而改变了值,原变量的值不会改变,从而造成应用程序读取的值和实际的变量值不一致举一个不太准确的例子:发薪资时,会计每
阅读全文
posted @
2013-09-30 16:22
Rosepotato
阅读(420)
推荐(0)
关于pragma pack的用法(一)
摘要:一个很重要的参数#pragma pack(n)数据边界对齐方式:以如下结构为例: struct { char a; WORD b; DWORD c; char d; }在Windows默认结构大小: sizeof(struct) = 4+4+4+4=16;与#pragma pack(4)一样若设为 #pragma pack(1), 则结构大小: sizeof(struct) = 1+2+4+1=8;若设为 #pragma pack(2), 则结构大小: sizeof(struct) = 2+2+4+2=10;在#pragma pack(1)时:空间是节省了,但访问速度降低了;结构体对齐的具体含
阅读全文
posted @
2013-07-16 15:37
Rosepotato
阅读(678)
推荐(0)