🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.os.linux
Article #13307

�ں�ģ�������

#13307
From: ����ˤ��һ��
Date: Fri, 25 Oct 2002 09:55
35 lines
4642 bytes
����������C++д�ں�ģ�飬û�뵽��Ȼ������һ����Ϊ���ε����⣬�����Ұװ��˷�2
��Сʱ��

���¾���������ģ�����C++д��һ���ں�ģ�飨��򵥵ģ�����HelloWorld���ּ�
�𣩣�Ȼ�������������ʹ��STL�е������࣬���޸Ĺ��������ǰһ�εij���д����
����ģ���޷�ж���������ҾͰ��޸Ĺ��ģ�����һ���������²��룬Ȼ����¾ͷ���
�ˣ�������ģ������������������˵�����Ϣ������������ô�ԣ�����һ���ֶ���
������Լ����2��Сʱ���������в쿴��һ��/proc/ksyms�����־�Ȼ�м����������һ
ģһ��ԭ��������ģ���еĺ�����ö��ܵ���ģ������ȥ�ˣ�����%��#%��*#%��%
��������������֮��һ�������������
�ѵ�Linux��װ��ģ���ʱ��û�м���ų�ͻ����֡�������

PS.��C++д�ں�ģ���ȷ�Ǹ�����£��ں�ͷ�ļ���Ȼ��new/delete/virtual������
����������ָ��ת��˿���������ƣ���g++���޷�����ͨ��ֻ��дһ��C��
stub�����������һ��Ѵ��?�����⣬�����ں���û��new/delete��ȱʡ���?
�����Ա���Ҫ�Զ���new��delete�������������Ƶ�ԭ��STL�е�allocator�Dz�
���õģ�û�취ֻ���Լ�дһ������򵥵�allocator����ֱ����allocate��
deallocate�����е�vmalloc��vfree����Ȼ�����п��ܻ�Ƚ��������Ǻ�STL��׼��
���򽻵���ʱ�����ǻ�Ƶ���ķ�����ͷŶ���STL�Լ���allocator�õ����ڴ�
�أ���������дһ��kernel_pool_allocator��ϣ���ܵõ���õ����ܣ�boost�������
��pool_allocator����ֱ���ã�������pthread���ں����������ⶫ��������������

�����ں���û��C++�쳣�����RTTI֧�֣������ڱ����ʱ������
-fno-exception -fno-rtti���أ���Ҳ�͵��ºܶ��಻���ã���������ں�ģ�鲻����
�ܸ��ӵ����Σ�����Ҳ����ʲô�����⣨����boost::any��û�����ˣ�������������
RTTI����

���⣬G++�����ڴ���volatile�����ʱ����һЩ���⣬����Ӧ�ñ������ں���ʹ��
volatile���������Ͽ�AlanCox˵�ģ���û˵��ʲô���⣬��Ҳû�ҵ���

���һ�㣬g++�ı����ٶȱ�gcc����һ����������������Ӧ����g++�м���Ԥ����ͷ��
�������ˡ�

Alan Cox˵���ȵ�g++���������������ˣ��Ϳ������ں���ʹ��C++���ڴ���һ�����
�١�������
Technical Details
Message-ID: <3db9e812@news.cn99.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!News.Newsfan.Net

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 10b277,e3faef2cf6111793
X-Google-Attributes: gid10b277,public
X-Google-ArrivalTime: 2002-10-25 09:38:06 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!News.Newsfan.Net
From: "����ˤ��һ��" <windoze@yeah.net>
Newsgroups: cn.comp.os.linux
Subject: �ں�ģ�������
Date: 25 Oct 2002 17:55:46 +0800
Organization: News.Newsfan.Net
Lines: 37
Message-ID: <3db9e812@news.cn99.com>
NNTP-Posting-Host: 218.21.102.254
X-Trace: mail.cn99.com 1035556664 3292 218.21.102.254 (25 Oct 2002 14:37:44 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Fri, 25 Oct 2002 14:37:44 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106