cÖ¸Õë
cÖ¸ÕëµÄÔËËãÓÐʱºò»¹ÊǺÜÃÔ»óÈ˵ġ£
ÀýÈ磺
struct student {
int num;
int score;
int length;
};
struct student *pt;
pt = (struct student *) malloc(sizeof(struct student));
pt->num = 1;
pt->score = 90;
pt->length = 3 * sizeof(int);
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;Ö®ºóptµÄÀàÐÍ»¹ÊÇstruct student£¬³¤¶È»¹ÊÇ12¡£
Ç¿ÖÆת»»ÀàÐÍÔËËã·û()µÄ×÷ÓÃÊÇ£ºÉú³ÉÒ»¸öint *ÀàÐ͵Äpt£¬µ«ÊÇptÔÀ´µÄÀàÐÍ»¹ÊÇû±ä£¬
»»¾ä»°Ëµ¾ÍÊÇ£¬Ç¿ÖÆת»»ÀàÐÍÔËËã·ûÖ»ÔÚÔËËãʱÆð×÷Ó㬲¢²»Ó°ÏìÔÀ´µÄÖµ¡£
Ïà¹ØÎĵµ£º
LinuxÄں˴úÂë·ÖÎö slab.c by Áõ¿º liukang@bjut.edu.cn
slab.cÀ´×ÔlinuxÄÚºË2.4.22°æ£¬±¾Îļþ°´ÕÕGNUÐÒé·¢²¼¡£
Ò»¡¢×¼±¸ÖªÊ¶£º
slabµÄ¸ÅÄ
Ìá³öµÄÔÒò£ºÓÉÓÚ²Ù×÷ϵͳÔÚÔËÐÐÖл᲻¶Ï²úÉú¡¢Ê¹Óá¢ÊÍ·Å´óÁ¿Öظ´µÄ¶ÔÏó£¬
ËùÒÔ¶ÔÕâÑùµÄÖظ´¶ÔÏóµÄÉú³É½øÐиĽø¿ÉÒÔ´ó´óÌá¸ßЧÂÊ
×îÔçÓÉsunµÄ¹¤³ÌʦÌá³ö(1994Äê)²¢Ê×ÏÈÔ ......
2.1 ¿É²âÐÔÎÊÌâÏê½â(2)
½ÓÏÂÀ´ÎÒÃÇÌÖÂÛÖصãÎÊÌ⣺¸²¸ÇÊäÈë¡£Ò»¸öº¯Êý£¬ÊäÈë»áÓÐÄÄЩÄØ£¿ÊäÈë°üÀ¨Á½·½Ã棺ÍⲿÊäÈ룬ÄÚ²¿ÊäÈë¡£ÍⲿÊäÈëÈÝÒ×Àí½â£¬¾ÍÊǺ¯ÊýÍⲿ¿ÉÒÔÉ趨µÄÊäÈ룬°üÀ¨²ÎÊý£¬È«¾Ö±äÁ¿£¬³ÉÔ±±äÁ¿¡£
&nb ......
BSS
δ³õʼ»¯µÄÊý¾Ý
DATA
³õʼ»¯µÄÊý¾Ý
TEXT(code)
´úÂë
ÔÚCÖÐÓÐÈ«¾Ö¡¢¾Ö²¿£¨×Ô¶¯±äÁ¿£©ºÍ¾²Ì¬±äÁ¿¡£
È«¾Ö±äÁ¿ÔÚCÓïÑÔÀï±íʾʱ£¬ÔÚº¯ÊýÖ®ÍâµÄ¾ÍÊÇÈ«¾Ö±äÁ¿£¬¼´ÔÚº¯ÊýÍâËùÉêÃ÷µÄ±äÁ¿£»¶ø¾²Ì¬±äÁ¿¿ÉÒÔ·ÅÔÚº¯ÊýÍ⣬Ҳ¿ÉÒÔ·ÅÔÚº¯ÊýÄÚ¡£È«¾Ö±äÁ¿ÓÐÁ½¸ö×÷Ó㺵ÚÒ»£¬µ±ÔÚº¯ÊýÍâÉê ......
C/C++ optimizing compilers are great--but there *are* a few techniques for hand-tuning your code to run as efficiently as possible on the AMD Athlon64 and Opteron processors, especially when developing DLLs, device drivers, or other performance-bound pieces of code.
Alan Zeichick
Share | ......
¡¡¡¡ÔÚ×öACMÌâʱ£¬¾³£¶¼»áÓöµ½Ò»Ð©±È½Ï´óµÄÕûÊý¡£¶ø³£ÓõÄÄÚÖÃÕûÊýÀàÐͳ£³£ÏÔµÃ̫СÁË£ºÆäÖÐlong ºÍ int
·¶Î§ÊÇ[-2^31,2^31)£¬¼´-2147483648~2147483647¡£¶øunsigned·¶Î§ÊÇ[0,2^32)£¬¼´
0~4294967295¡£Ò²¾ÍÊÇ˵£¬³£¹æµÄ32λÕûÊýÖ»Äܹ»´¦Àí40ÒÚÒÔϵÄÊý¡£
¡¡¡¡ÄÇÓöµ½±È40ÒÚÒª´óµÄÊýÔõô°ìÄØ£¿Õâʱ¾ÍÒªÓõ½C++µÄ64λÀ©Õ¹ ......