| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> bao chi C/C++ cheng xu dai ma de ke shen suo xing

bao chi C/C++ cheng xu dai ma de ke shen suo xing

2008-06-01 02:06:04 编辑來源:互联网 评论
 
 
 
本文为【保持C/C++程序代码的可伸缩性】的拼音翻译版
  zai jin tian , yi you xu duo de 32 wei ying yong cheng xu gan dao , zai 32 wei ping tai shang ke yong de xu ni nei cun shou dao le yi ding de xian zhi , dui cheng xu kai fa zhe lai shuo , ji shi shi kai shi guan zhu 64 wei ping tai shi , ye bu de bu wei hu ruan jian de 32 wei ban ben , zhe jiu xu yao yi zhong fang fa , yi shi dai ma de liang ge ban ben dou bao chi xiang dang de ke shen suo xing 。
  mu qian de nei cun pou xi gong ju neng bang zhu que ding , dang cheng xu da dao feng zhi nei cun shi yong liang shi , dou fa sheng le shen me , dan shi zhe xie gong ju dou guo yu guan zhu yi fen pei de nei cun kuai , er bu shi yi ti jiao de xu ni nei cun di zhi kong jian , er zhe liang zhong heng liang biao zhun mei you zhi jie de xiang guan xing , ru nei cun xie lou 、 nei cun sui pian 、 nei cun kuai nei de kong jian lang fei 、 huo guo du yan chi de nei cun dan yuan chong xin fen pei zhe xie yin su , dou hui dao zhi bu bi yao de xu ni nei cun ti jiao 。 yun xing shi fen xi gong ju ru IBM Rational Purify huo Parasoft Inuse yun ke yi ti gong nei cun xie lou ji yi yong nei cun de miao shu , zhe xie xin xi shi fei chang you yong de , dan shi , yi ge fei fan de nei cun kuai ye xu ke neng 、 ye xu bu ke neng ying xiang dao xu ni nei cun fu gai qu , ling wai , shen zhi yi ge you sui pian de nei cun dui zhong de yi ge xiao kuai , ye neng zhi jie ying xiang dao xu ni nei cun fu gai qu 。 cong ling yi fang mian lai shuo , zai ci fan wei nei de ren yi nei cun kuai -- shen zhi xie lou de kuai , dui xu ni nei cun fu gai qu lai shuo , ye bu hui yu zhi you shen me guan xi , chu fei mei yi ge ci fan wei nei you yong de nei cun kuai neng chong xin fen pei dao yi ge geng jin cou de fan wei nei , zhe jiu you dian xiang Java huo tuo guan cheng xu de la ji hui shou ji zhi , dan dui da duo shu C/C++ ben di ying yong cheng xu lai shuo , jiu jue dui bu ke neng le , yin wei zai xu ni nei cun kong jian zhong , ta men nei cun kuai de wei zhi shi bu que ding de 。
  zhi yu ben di dai ma , bu bi yao de xu ni nei cun shi yong , zhe ge shi ji de wen ti , bi wei qing li de nei cun kuai zhe ge li lun shang de wen ti , geng jia you shi zhi xing 。 wei qing li de nei cun kuai ke neng dao zhi xu ni nei cun de lang fei , zao cheng guo duo de xi tong kai xiao , dan huo zhe bu hui ; zhe wan quan yi kao yu dui zhi li qi shi fou ti jiao le geng duo de xu ni nei cun , yi zhi cheng zhe zhong lang fei 。 mou xie hen xiao de wei shi yong de nei cun kuai , bu hui yin qi bu bi yao de dui " kuo zhan "。 yu qi rang ni lai cai na yi ge huo duo shao yi lang fei de nei cun kuai dao zhi le dui kuo zhan , dao bu ru xue hui zen yang pan ding chu you yi yi de lang fei shi shen me 。 dang dui zhong bao han bu zai shi yong de nei cun kuai shi , ci shi tong guo jia ru dui wei suo jian dui de jian cha , jiu neng que ding chu yu ni de cheng xu xu ni nei cun yao qiu you hen da guan xi de 、 bi xu jin xing de nei cun kuai qing li 。
  wei zhao chu na yi ge dui zhong de nei cun kuai xu duo liu yi , bi xu zai cheng xu zhong jia ru yi xie e wai de dai ma , yi gen zong nei cun dui fan wei ji yi fen pei de nei cun kuai 。 dui e wai de dai ma jin xing tiao jian bian yi , sheng cheng yi ge te ding de ban ben , ye xu shi yi ge bu cuo de ban fa 。
  wei da dao ci mu de , xu bian xie zi ding yi de nei cun fen pei li cheng , bing gen zong mei yi ge nei cun kuai , ling you yi ge zi ding yi de shi fang li cheng , qie gen zong xu ni nei cun zhong dui de wei zhi , qing shen jian li 1 yu li 2 de wei dai ma suan fa 。 ke neng huan xu bian xie zi ding yi de fang wen han shu yi biao ji chu fang wen guo de nei cun kuai , yi bian yu zai shi dang de shi hou shi fang xu ni nei cun , suo you zhe xie bing bu xu yao guo duo de nei cun kai xiao 。 ling yi fang mian , jia ru ni de cheng xu yi dui de xing shi shi yong le da liang de nei cun , na me jiang hui ji da di jiang di xing neng , ci chu de fang fa ye bu shi chang jiu zhi ji 。
  li 1:
  
  /* shu ru shen shu */
  ADDRESS triggerAddr
  SIZE triggerSize
  LIST a list of tracked heap ranges
  IF (the virtual memory at triggerAddr is tracked on the list as part of a heap range)
  DO
  IF (triggerAddr + triggerSize >
  (the tracked upper boundary of that heap range))
  DO
  /* yi ge xian you de dui fan wei bei kuo zhan */
  make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize)
  update the size of the tracked heap range to indicate its new upper limit
  END
  END
  ELSE DO
  /* zai triggerAddr zhong you yi ge xin de dui fan wei */
  make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize)
  track the new committed range in the list of heap ranges
  END
  li 2:
  
  /* shu ru shen shu */
  ADDRESS triggerAddr
  SIZE triggerSize
  LIST a list of tracked heap ranges
  /* ju bu bian liang */
  ADDRESS origRangeBase
  SIZE origRangeSize
  BOOL bFoundChange
  bFoundChange = FALSE
  IF (the virtual memory at triggerAddr is not tracked on the heap range list as part of a heap range)
  DO
  /* si hu wo men yi jing qing chu ci ci shi fang le 。*/
  END
  ELSE IF (an Access exception occurs when memory at triggerAddr is read)
  DO
  bFoundChange = TRUE
  END
  IF (bFoundChange) DO
  /* yin wei zhi qian nei cun kuai zhan yong de kong jian bei shi fang le , suo yi dui zhan yong de xu ni nei cun fan wei jiu gai bian le 。*/
  make system calls to determine the bases and extents of the tracked committed heap ranges in the immediate vicinity of the decommitted range that includes the addresses from triggerAddr to (triggerAddr + triggerSize)
  /* geng xin dui fan wei gen zong , yi fan yang sheng yu ti jiao de fan wei */
  IF (any portion of the tracked heap range that contained the block at TriggerAddr is still committed)
  DO
  update the heap range list to track just the portion(s) of that range that remain committed
  END
  ELSE
  DO
  delete the list element that tracks the range
  END
  END
  
  
  
  
   QQread.com
   tui chu Windows2003 jiao cheng
  
  
   win2003 an zhuang jie shao
   win2003 wang luo you hua
   win2003 shi yong ji qiao
  
  
   win2003 xi tong gu zhang
   fu wu qi pei zhi
   zhuan jia da yi
  
  
  
  
  
   geng duo de qing kan :http://www.qqread.com/windows/2003/index.Html gen zong dui nei cun kuai
  ke shi yong zi ding yi de nei cun fen pei han shu lai jin xing nei cun kuai de gen zong , er zhe zhong han shu zui chu bei cheng wei pu tong nei cun fen pei han shu , ju li lai shuo ,C yu yan cheng xu zhong yi ban shi yong malloc(), er hou , zi ding yi de nei cun fen pei hui jin xing yi xia yi xi lie de cao zuo :
  · zai mu qian yi fen pei de nei cun kuai lie biao zhong , gen zong xin fen pei de nei cun kuai 。
  · jue ding shi fou xiang xi tong ti jiao xu ni nei cun 。
  · jia ru xu ni nei cun yi bei ti jiao , gen zong bao han ci nei cun kuai de dui fan wei , bing geng xin shang shu dui nei cun kuai lie biao , yi biao shi chu cong wei bei fang wen guo de nei cun kuai 。
  huan xu yao zi ding yi de shi fang yu chong fen pei nei cun han shu , yi bian tong guo cheng xu zhong shi yong de nei cun kuai de di zhi yu da xiao , lai geng xin nei cun kuai lie biao 。 suo gen zong de dui nei cun kuai lie biao ying bao han ru xia jie gou :
  · nei cun kuai de ji di zhi 。
  · zi shen da xiao
  · yong yu zhi shi zi cong shang ci xu ni nei cun bei ti jiao zhi hou , nei cun kuai shi fou bei fang wen guo de bu er zhi 。
  dang yi ge nei cun kuai bei shi fang hou , zi ding yi de shi fang dai ma jiang hui jin xing yi xia cao zuo :
  · jia ru zi cong shang ci dui kuo zhan zhi hou , nei cun kuai huan wei bei fang wen guo , jiang xiang cheng xu bao gao 。
  · cong lie biao zhong shan chu gen zong de nei cun kuai 。
  · pan ding xi tong shi fou yi shi fang le bao han ci nei cun kuai de xu ni nei cun 。
  · jia ru xu ni nei cun bei shi fang , yao xiang ying di geng xin , yi fan yang sheng yu de dui fan wei 。
  dang yi ge nei cun kuai bei chong xin fen pei shi , ni de zi ding yi chong xin fen pei nei cun dai ma bi xu jin xing yi xia liang zhong cao zuo : shou xian , zai shi fang zhi hou chong xin gen zong nei cun kuai , yin wei chong xin fen pei de nei cun kuai ke neng bu zai yuan wei zhi ; qi ci , zai fen pei zhi hou ye yao chong xin gen zong xin de ji di zhi ji fen pei nei cun kuai de da xiao 。 ling you yi ge ke xuan de fang fa , ni ke jian cha shi fou chong xin fen pei de nei cun kuai bei yi dong le , jia ru mei you bei yi dong , zhi xu jin jin geng xin nei cun kuai gen zong lie biao , biao chu ci nei cun kuai de da xiao ; jia ru nei cun kuai huan zai tong yi ji di zhi , dan shi zeng chang le , ci shi jiu yao jian cha dui kuo zhan , bing an zhao qian shu fen pei nei cun de fang fa chong lai yi bian 。
  gen zong dui zi shen
  dui gen zong qu jue yu dang nei cun kuai bei fen pei huo shi fang shi , xu ni nei cun shi fou fen bie bei ti jiao huo shi fang , yi ci ke yi jian li yi zhang dui nei cun fan wei gen zong biao , yi que ding zai cheng xu yun xing qi jian , xu ni nei cun kong jian zhong dui de que qie wei zhi , gen zong lie biao zhong ying bao kuo ru xia shu ju :
  · gen zong fan wei de ji di zhi
  · zi shen da xiao
  zai Windows cao zuo xi tong zhong , zhe xie zhi ke tong guo HeapWalk() tiao yong huo de , ci chu yao zhu chong de shi ,HeapWalk() han shu tiao yong kai xiao ju da , yin ci , zhi zai cheng xu xu yao shi tiao yong , er bu shi dang you nei cun fen pei huo shi fang shi dou tiao yong 。 ling yi zhong Windows shang de fang fa shi shi yong IsBadReadPointer() han shu , dang yi ge nei cun kuai bei shi fang hou , ni ke yi tiao yong zhe ge han shu kuai su di pan ding bao han ci nei cun kuai de xu ni nei cun shi fou yi bei shi fang 。 ling yi ge ke yi kua ping tai de bei xuan fang fa shi , ke shi zhe fang wen bao han ci nei cun kuai de xu ni nei cun , bing bu zhuo ke neng fa sheng de fang wen yi chang 。 ci wai , zhi you zai yi zhong qing kuang xia hui kao lv shi yong ru HeapWalk() zhe yang kai xiao ju da de han shu , jiu shi xu pan ding lin jin sheng yu de yi ti jiao dui fan wei 。
  tong guo yi zhong tan ce dui nei cun ti jiao de suan fa , dui nei cun gen zong lie biao hui bu duan di zeng chang , ru li 1 zhong suo shi 。 yao zhu chong de shi , dang ni de cheng xu fen pei yi ge nei cun kuai shi , zi ding yi de nei cun fen pei dai ma ye neng gen zong dao zhe xie nei cun kuai , bing shi yong li 1 zhong de suan fa lai geng xin bao han nei cun kuai de dui lie biao 。 jia ru yi ge nei cun kuai de fen pei dao zhi le e wai de xu ni nei cun bei ti jiao , na me bei nei cun kuai zhan yong de xu ni nei cun hui zai zhi qian jiu shi fang , huo xu zhi qian jiu bei yong zuo bie de yong tu 。 zai ren yi qing kuang zhong , bi xu you tiao jian di geng xin dui fan wei gen zong lie biao : l jia ru zheng zai gen zong yi ti jiao fan wei de ji di zhi , ci shi bi xu geng xin fan wei de da xiao , yi zhi shi chu xin de fan wei shang xian 。
  · fou ze , bi xu jian li yi zhang xin de dui nei cun fan wei gen zong biao 。
  jia ru yi ge xin de nei cun kuai chu xian zai yi ge zhi qian wei bei gen zong de dui fan wei zhong , jiu man zu le yi shang tiao jian , ci shi ming zhi di shi yong qian shu de xi tong tiao yong ke gao xiao di gen zong dui nei cun fan wei 。
  dang ni de cheng xu shi fang yi ge nei cun kuai shi , zi ding yi de nei cun shi fang dai ma hui shi yong dao ru li 2 zhong de suan fa , ci suan fa hui xian pan ding shi fang de nei cun shi fou yu bei gen zong de dui nei cun fan wei you guan ; jie xia lai , bi xu jian cha yi shi fang nei cun kuai zhan yong de kong jian shi fou reng chu yu ti jiao zhuang tai , jia ru shi , biao ming le ji shi nei cun kuai bei shi fang , xu ni nei cun de fu gai qu ye mei you fa sheng gai bian , fou ze , ni de dai ma bi xu jin xing ru li 2 jie yi chu de xi tong tiao yong -- ru Windows zhong de HeapWalk()-- yi que bao gen zong de dui shi zui xin de , qie bao han dui nei cun kuai de xu ni nei cun yi bei shi fang 。
  jia ru xu ni nei cun yi jing bei ti jiao , na me ni ying gai jian cha na xie tong chang bao han le zui jin bei shi fang de dui nei cun kuai de nei cun fan wei , yi que ren shi fou you ci fan wei nei de nei cun bei ti jiao , er ci fan wei nei ren he bei ti jiao de nei cun bu fen dou ying gai shi zai yi ge dui nei cun fan wei nei , fei fan shi jia ru ta bao han le gen zong lie biao shang de nei cun kuai , jin xing ci jian cha ke bao zheng jin yi bu de zhun que xing 。 jie xia lai huan you yi xia liang jian shi , ru li 2 zhong suo shi :
  · jia ru bei gen zong de dui nei cun fan wei nei ren yi bu fen bei ti jiao , bi xu geng xin ni de gen zong lie biao 。
  · fou ze , shan chu lie biao zhong de yuan su bing gen zong xin de fan wei 。
  jia ru ti jiao de bu fen zai zhong jian , na me jiu you ke neng ba dui nei cun fan wei jie cheng hao ji duan , zong er yan zhi , zai ni fang qi gen zong lao de fan wei zhi qian , ying xian zai quan fan wei nei jian cha yi xia na yi bu fen reng chu yu ti jiao zhuang tai 。
  cheng xu zhong ke neng hui yong dao hao ji ge bu tong de dui , zai Windows shang , jia ru ni tiao yong HeapCreate() bing ba fan hui de ju bing chuan gei jie xia lai de HeapAlloc()、HeapReAlloc()、HeapFree() han shu tiao yong shi , jiu hui chuang jian yi xie bu tong de dui ; ling wai , jia ru ni jia zai le C yun xing shi ku DLL de duo ge shi li , ye hui yin wei mei ge shi li shi yong ta men zi ji de dui er chan sheng duo ge dui 。 ci shi , ke zai bu tong de lie biao zhong gen zong duo ge dui , ye ke zai bu tong de lie biao zhong gen zong ta men de nei cun kuai 。 shou xian , zhe yang zuo de hao chu shi , lie biao de cha zhao ke yi bian de hen kuai , qi ci , dang dui bei " cui hui " shi , ni ke yi hao wu gu lv di qing chu gen zong lie biao , dan zhe xu yao zai dui chuang jian he shi fang shi jia ru e wai de dai ma lai wan cheng -- ji fen bie she zhi he shan chu dui ying de lie biao 。 ling wai , ni ye ke zhi li yi ge dui nei cun kuai de lie biao ji yi ge dui fan wei de lie biao , bing zai cheng xu kai shi yun xing shi jian li ta men 。
  yi xie zhuan ye de yun xing shi fen xi gong ju ye neng dui fen pei de nei cun kuai ji dui fan wei jin xing gen zong , jiu xiang qian mian suo shuo de zi ding yi nei cun fen pei han shu yu shi fang han shu yi yang , shen zhi huan neng tong guo ji ben de xu ni nei cun HASH zhi (ox187d690) jin yi bu gen zong , yi bian wei jing que de yun xing shi cuo wu jian ce ti gong geng jia ke kao de shou duan 。 dan ci chu miao shu de fang fa bing bu zu yi bang zhu ni li jie he shi cai neng zhao dao tong guo cheng xu ke kong zhi de dui nei cun kuai , jian shao xu ni nei cun xiao hao de shi ji 。
  zhao dao shi dang de qing li shi ji
  wei shi yong gen zong xin xi yi jing que ding wei na xie dao zhi xu ni nei cun bu bi yao zeng chang de dui nei cun kuai , ni huan bi xu yao ji lu xia nei cun fang wen dong zuo , bing zai cheng xu du xie dui nei cun shi , biao ji chu xiang ying de nei cun kuai gen zong jie gou 。
  
   jia ru ni de dui nei cun kuai dou shi tong guo cun qu han shu fang wen de , na me hen qing yi jiu ke zhao dao suo you dai ma du xie de nei cun bu fen , bing yi tiao jian bian yi sheng cheng yi ge te ding de ban ben 。 zhe xie cun qu han shu ke cha zhao ni lie biao shang bei fang wen guo de nei cun kuai , bing she zhi bu er zhi zuo chu biao ji 。
  dang xu ni nei cun bei ti jiao sheng cheng yi ge dui , ni de zi ding yi nei cun fen pei han shu ying qu xiao dui zhong suo you nei cun kuai de biao ji , er zai jie xia lai , ta men ke neng hui chong xin bei biao ji shang , yi ge jie yi ge , jiu xiang ni de cheng xu zheng zai fang wen ta men 。 dang yi ge qu xiao biao ji de nei cun kuai bei shi fang shi , xiang ying de xu ni nei cun ye hui bei shi fang , ci shi ni zi ding yi de shi fang han shu jiu hui xian yi bu shi fang nei cun kuai , yi jian xiao xu ni nei cun de fu gai fan wei 。
  ye ke an pai dui dui nei cun kuai zuo yi xie lin shi de sao miao , zhe ye xu ke zai mei yi ci xu ni nei cun ti jiao shi jin xing 。 jia ru yi ge nei cun kuai zai jing guo duo bian sao miao hou reng bao chi wei biao ji zhuang tai ( ye xu hui hua hen chang shi jian ), ze bao han ci nei cun kuai de xu ni nei cun fan wei jiu bi xu dui suo gen zong de nei cun kuai shu jin xing jian cha 。 jia ru na ge nei cun kuai , huo zhe yi zu bei hu shi de lei si nei cun kuai , zhi shi dan du di yu ti jiao de xu ni nei cun you guan xi , na me tong guo shi fang yu chong xin ding wei zhe xie nei cun kuai , ni ke neng yi jing zhao dao yi ge jian shao cheng xu xu ni nei cun yao qiu de hao fang fa 。
  jia ru ni shi xian le ci chu miao shu de suo you nei cun kuai he dui fan wei gen zong dai ma , er dang zhe xie suo you de gen zong dou qi zuo yong shi , na me cheng xu de su du jiang hui bian de hen man , zhu yao shi yin wei zai mei yi ci dui nei cun fang wen shi , dou hui jin xing yi bian lie biao cha zhao , dang ran , ye ke yi tong guo yi xie kuai su lie biao cha zhao fang fa ru er fen fa cha zhao 、 tiao yue cha zhao zhi lei de lai suo duan cha zhao de shi jian , huan ke shi yong dui ying mei ge dui de dan du lie biao lai jia su cha zhao 。 jia ru cheng xu shi yong le xu duo de dui nei cun kuai , bing qie ye zhao dao le jian shao e wai xu ni nei cun xiao hao de fang fa , yi wang suo hua fei de suo you jing li yu nai xin , yu ci shi de dao de hui bao xiang bi , jiu suan bu shang shen me le 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
   zai jin tian , yi you xu duo de 32 wei ying yong cheng xu gan dao , zai 32 wei ping tai shang ke yong de xu ni nei cun shou dao le yi ding de xian zhi , dui cheng xu kai fa zhe lai shuo , ji shi shi kai shi guan zhu 64 wei ping tai shi , ye bu de bu wei hu ruan jian de 32 wei ban ben , zhe jiu xu yao yi zhong fang fa , yi shi dai ma de liang ge ban ben dou bao chi xiang dang de ke shen suo xing 。    mu qian de nei cun pou xi gong ju neng bang zhu que ding , dang cheng xu da dao feng zhi nei cun shi yong liang shi , dou fa sheng le shen me , dan shi zhe xie gong ju dou guo yu guan zhu yi fen pei de nei cun kuai , er bu shi yi ti jiao de xu ni nei cun di zhi kong jian , er zhe liang zhong heng liang biao zhun mei you zhi jie de xiang guan xing , ru nei cun xie lou 、 nei cun sui pian 、 nei cun kuai nei de kong jian lang fei 、 huo guo du yan chi de nei cun dan yuan chong xin fen pei zhe xie yin su , dou hui dao zhi bu bi yao de xu ni nei cun ti jiao 。 yun xing shi fen xi gong ju ru IBM Rational Purify huo Parasoft Inuse yun ke yi ti gong nei cun xie lou ji yi yong nei cun de miao shu , zhe xie xin xi shi fei chang you yong de , dan shi , yi ge fei fan de nei cun kuai ye xu ke neng 、 ye xu bu ke neng ying xiang dao xu ni nei cun fu gai qu , ling wai , shen zhi yi ge you sui pian de nei cun dui zhong de yi ge xiao kuai , ye neng zhi jie ying xiang dao xu ni nei cun fu gai qu 。 cong ling yi fang mian lai shuo , zai ci fan wei nei de ren yi nei cun kuai -- shen zhi xie lou de kuai , dui xu ni nei cun fu gai qu lai shuo , ye bu hui yu zhi you shen me guan xi , chu fei mei yi ge ci fan wei nei you yong de nei cun kuai neng chong xin fen pei dao yi ge geng jin cou de fan wei nei , zhe jiu you dian xiang Java huo tuo guan cheng xu de la ji hui shou ji zhi , dan dui da duo shu C/C++ ben di ying yong cheng xu lai shuo , jiu jue dui bu ke neng le , yin wei zai xu ni nei cun kong jian zhong , ta men nei cun kuai de wei zhi shi bu que ding de 。    zhi yu ben di dai ma , bu bi yao de xu ni nei cun shi yong , zhe ge shi ji de wen ti , bi wei qing li de nei cun kuai zhe ge li lun shang de wen ti , geng jia you shi zhi xing 。 wei qing li de nei cun kuai ke neng dao zhi xu ni nei cun de lang fei , zao cheng guo duo de xi tong kai xiao , dan huo zhe bu hui ; zhe wan quan yi kao yu dui zhi li qi shi fou ti jiao le geng duo de xu ni nei cun , yi zhi cheng zhe zhong lang fei 。 mou xie hen xiao de wei shi yong de nei cun kuai , bu hui yin qi bu bi yao de dui " kuo zhan "。 yu qi rang ni lai cai na yi ge huo duo shao yi lang fei de nei cun kuai dao zhi le dui kuo zhan , dao bu ru xue hui zen yang pan ding chu you yi yi de lang fei shi shen me 。 dang dui zhong bao han bu zai shi yong de nei cun kuai shi , ci shi tong guo jia ru dui wei suo jian dui de jian cha , jiu neng que ding chu yu ni de cheng xu xu ni nei cun yao qiu you hen da guan xi de 、 bi xu jin xing de nei cun kuai qing li 。    wei zhao chu na yi ge dui zhong de nei cun kuai xu duo liu yi , bi xu zai cheng xu zhong jia ru yi xie e wai de dai ma , yi gen zong nei cun dui fan wei ji yi fen pei de nei cun kuai 。 dui e wai de dai ma jin xing tiao jian bian yi , sheng cheng yi ge te ding de ban ben , ye xu shi yi ge bu cuo de ban fa 。    wei da dao ci mu de , xu bian xie zi ding yi de nei cun fen pei li cheng , bing gen zong mei yi ge nei cun kuai , ling you yi ge zi ding yi de shi fang li cheng , qie gen zong xu ni nei cun zhong dui de wei zhi , qing shen jian li 1 yu li 2 de wei dai ma suan fa 。 ke neng huan xu bian xie zi ding yi de fang wen han shu yi biao ji chu fang wen guo de nei cun kuai , yi bian yu zai shi dang de shi hou shi fang xu ni nei cun , suo you zhe xie bing bu xu yao guo duo de nei cun kai xiao 。 ling yi fang mian , jia ru ni de cheng xu yi dui de xing shi shi yong le da liang de nei cun , na me jiang hui ji da di jiang di xing neng , ci chu de fang fa ye bu shi chang jiu zhi ji 。    li 1: /* shu ru shen shu */ ADDRESS triggerAddr SIZE triggerSize LIST a list of tracked heap ranges IF (the virtual memory at triggerAddr is tracked on the list as part of a heap range) DO IF (triggerAddr + triggerSize > (the tracked upper boundary of that heap range)) DO /* yi ge xian you de dui fan wei bei kuo zhan */ make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize) update the size of the tracked heap range to indicate its new upper limit END END ELSE DO /* zai triggerAddr zhong you yi ge xin de dui fan wei */ make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize) track the new committed range in the list of heap ranges END    li 2: /* shu ru shen shu */ ADDRESS triggerAddr SIZE triggerSize LIST a list of tracked heap ranges /* ju bu bian liang */ ADDRESS origRangeBase SIZE origRangeSize BOOL bFoundChange bFoundChange = FALSE IF (the virtual memory at triggerAddr is not tracked on the heap range list as part of a heap range) DO /* si hu wo men yi jing qing chu ci ci shi fang le 。*/ END ELSE IF (an Access exception occurs when memory at triggerAddr is read) DO bFoundChange = TRUE END IF (bFoundChange) DO /* yin wei zhi qian nei cun kuai zhan yong de kong jian bei shi fang le , suo yi dui zhan yong de xu ni nei cun fan wei jiu gai bian le 。*/ make system calls to determine the bases and extents of the tracked committed heap ranges in the immediate vicinity of the decommitted range that includes the addresses from triggerAddr to (triggerAddr + triggerSize) /* geng xin dui fan wei gen zong , yi fan yang sheng yu ti jiao de fan wei */ IF (any portion of the tracked heap range that contained the block at TriggerAddr is still committed) DO update the heap range list to track just the portion(s) of that range that remain committed END ELSE DO delete the list element that tracks the range END END QQread.com tui chu Windows2003 jiao cheng win2003 an zhuang jie shao win2003 wang luo you hua win2003 shi yong ji qiao win2003 xi tong gu zhang fu wu qi pei zhi zhuan jia da yi geng duo de qing kan :http://www.qqread.com/windows/2003/index.Html gen zong dui nei cun kuai    ke shi yong zi ding yi de nei cun fen pei han shu lai jin xing nei cun kuai de gen zong , er zhe zhong han shu zui chu bei cheng wei pu tong nei cun fen pei han shu , ju li lai shuo ,C yu yan cheng xu zhong yi ban shi yong malloc(), er hou , zi ding yi de nei cun fen pei hui jin xing yi xia yi xi lie de cao zuo :   · zai mu qian yi fen pei de nei cun kuai lie biao zhong , gen zong xin fen pei de nei cun kuai 。   · jue ding shi fou xiang xi tong ti jiao xu ni nei cun 。   · jia ru xu ni nei cun yi bei ti jiao , gen zong bao han ci nei cun kuai de dui fan wei , bing geng xin shang shu dui nei cun kuai lie biao , yi biao shi chu cong wei bei fang wen guo de nei cun kuai 。    huan xu yao zi ding yi de shi fang yu chong fen pei nei cun han shu , yi bian tong guo cheng xu zhong shi yong de nei cun kuai de di zhi yu da xiao , lai geng xin nei cun kuai lie biao 。 suo gen zong de dui nei cun kuai lie biao ying bao han ru xia jie gou :   · nei cun kuai de ji di zhi 。   · zi shen da xiao   · yong yu zhi shi zi cong shang ci xu ni nei cun bei ti jiao zhi hou , nei cun kuai shi fou bei fang wen guo de bu er zhi 。    dang yi ge nei cun kuai bei shi fang hou , zi ding yi de shi fang dai ma jiang hui jin xing yi xia cao zuo :   · jia ru zi cong shang ci dui kuo zhan zhi hou , nei cun kuai huan wei bei fang wen guo , jiang xiang cheng xu bao gao 。   · cong lie biao zhong shan chu gen zong de nei cun kuai 。   · pan ding xi tong shi fou yi shi fang le bao han ci nei cun kuai de xu ni nei cun 。   · jia ru xu ni nei cun bei shi fang , yao xiang ying di geng xin , yi fan yang sheng yu de dui fan wei 。    dang yi ge nei cun kuai bei chong xin fen pei shi , ni de zi ding yi chong xin fen pei nei cun dai ma bi xu jin xing yi xia liang zhong cao zuo : shou xian , zai shi fang zhi hou chong xin gen zong nei cun kuai , yin wei chong xin fen pei de nei cun kuai ke neng bu zai yuan wei zhi ; qi ci , zai fen pei zhi hou ye yao chong xin gen zong xin de ji di zhi ji fen pei nei cun kuai de da xiao 。 ling you yi ge ke xuan de fang fa , ni ke jian cha shi fou chong xin fen pei de nei cun kuai bei yi dong le , jia ru mei you bei yi dong , zhi xu jin jin geng xin nei cun kuai gen zong lie biao , biao chu ci nei cun kuai de da xiao ; jia ru nei cun kuai huan zai tong yi ji di zhi , dan shi zeng chang le , ci shi jiu yao jian cha dui kuo zhan , bing an zhao qian shu fen pei nei cun de fang fa chong lai yi bian 。    gen zong dui zi shen    dui gen zong qu jue yu dang nei cun kuai bei fen pei huo shi fang shi , xu ni nei cun shi fou fen bie bei ti jiao huo shi fang , yi ci ke yi jian li yi zhang dui nei cun fan wei gen zong biao , yi que ding zai cheng xu yun xing qi jian , xu ni nei cun kong jian zhong dui de que qie wei zhi , gen zong lie biao zhong ying bao kuo ru xia shu ju :   · gen zong fan wei de ji di zhi   · zi shen da xiao    zai Windows cao zuo xi tong zhong , zhe xie zhi ke tong guo HeapWalk() tiao yong huo de , ci chu yao zhu chong de shi ,HeapWalk() han shu tiao yong kai xiao ju da , yin ci , zhi zai cheng xu xu yao shi tiao yong , er bu shi dang you nei cun fen pei huo shi fang shi dou tiao yong 。 ling yi zhong Windows shang de fang fa shi shi yong IsBadReadPointer() han shu , dang yi ge nei cun kuai bei shi fang hou , ni ke yi tiao yong zhe ge han shu kuai su di pan ding bao han ci nei cun kuai de xu ni nei cun shi fou yi bei shi fang 。 ling yi ge ke yi kua ping tai de bei xuan fang fa shi , ke shi zhe fang wen bao han ci nei cun kuai de xu ni nei cun , bing bu zhuo ke neng fa sheng de fang wen yi chang 。 ci wai , zhi you zai yi zhong qing kuang xia hui kao lv shi yong ru HeapWalk() zhe yang kai xiao ju da de han shu , jiu shi xu pan ding lin jin sheng yu de yi ti jiao dui fan wei 。    tong guo yi zhong tan ce dui nei cun ti jiao de suan fa , dui nei cun gen zong lie biao hui bu duan di zeng chang , ru li 1 zhong suo shi 。 yao zhu chong de shi , dang ni de cheng xu fen pei yi ge nei cun kuai shi , zi ding yi de nei cun fen pei dai ma ye neng gen zong dao zhe xie nei cun kuai , bing shi yong li 1 zhong de suan fa lai geng xin bao han nei cun kuai de dui lie biao 。 jia ru yi ge nei cun kuai de fen pei dao zhi le e wai de xu ni nei cun bei ti jiao , na me bei nei cun kuai zhan yong de xu ni nei cun hui zai zhi qian jiu shi fang , huo xu zhi qian jiu bei yong zuo bie de yong tu 。 zai ren yi qing kuang zhong , bi xu you tiao jian di geng xin dui fan wei gen zong lie biao : l jia ru zheng zai gen zong yi ti jiao fan wei de ji di zhi , ci shi bi xu geng xin fan wei de da xiao , yi zhi shi chu xin de fan wei shang xian 。   · fou ze , bi xu jian li yi zhang xin de dui nei cun fan wei gen zong biao 。    jia ru yi ge xin de nei cun kuai chu xian zai yi ge zhi qian wei bei gen zong de dui fan wei zhong , jiu man zu le yi shang tiao jian , ci shi ming zhi di shi yong qian shu de xi tong tiao yong ke gao xiao di gen zong dui nei cun fan wei 。    dang ni de cheng xu shi fang yi ge nei cun kuai shi , zi ding yi de nei cun shi fang dai ma hui shi yong dao ru li 2 zhong de suan fa , ci suan fa hui xian pan ding shi fang de nei cun shi fou yu bei gen zong de dui nei cun fan wei you guan ; jie xia lai , bi xu jian cha yi shi fang nei cun kuai zhan yong de kong jian shi fou reng chu yu ti jiao zhuang tai , jia ru shi , biao ming le ji shi nei cun kuai bei shi fang , xu ni nei cun de fu gai qu ye mei you fa sheng gai bian , fou ze , ni de dai ma bi xu jin xing ru li 2 jie yi chu de xi tong tiao yong -- ru Windows zhong de HeapWalk()-- yi que bao gen zong de dui shi zui xin de , qie bao han dui nei cun kuai de xu ni nei cun yi bei shi fang 。    jia ru xu ni nei cun yi jing bei ti jiao , na me ni ying gai jian cha na xie tong chang bao han le zui jin bei shi fang de dui nei cun kuai de nei cun fan wei , yi que ren shi fou you ci fan wei nei de nei cun bei ti jiao , er ci fan wei nei ren he bei ti jiao de nei cun bu fen dou ying gai shi zai yi ge dui nei cun fan wei nei , fei fan shi jia ru ta bao han le gen zong lie biao shang de nei cun kuai , jin xing ci jian cha ke bao zheng jin yi bu de zhun que xing 。 jie xia lai huan you yi xia liang jian shi , ru li 2 zhong suo shi :   · jia ru bei gen zong de dui nei cun fan wei nei ren yi bu fen bei ti jiao , bi xu geng xin ni de gen zong lie biao 。   · fou ze , shan chu lie biao zhong de yuan su bing gen zong xin de fan wei 。    jia ru ti jiao de bu fen zai zhong jian , na me jiu you ke neng ba dui nei cun fan wei jie cheng hao ji duan , zong er yan zhi , zai ni fang qi gen zong lao de fan wei zhi qian , ying xian zai quan fan wei nei jian cha yi xia na yi bu fen reng chu yu ti jiao zhuang tai 。    cheng xu zhong ke neng hui yong dao hao ji ge bu tong de dui , zai Windows shang , jia ru ni tiao yong HeapCreate() bing ba fan hui de ju bing chuan gei jie xia lai de HeapAlloc()、HeapReAlloc()、HeapFree() han shu tiao yong shi , jiu hui chuang jian yi xie bu tong de dui ; ling wai , jia ru ni jia zai le C yun xing shi ku DLL de duo ge shi li , ye hui yin wei mei ge shi li shi yong ta men zi ji de dui er chan sheng duo ge dui 。 ci shi , ke zai bu tong de lie biao zhong gen zong duo ge dui , ye ke zai bu tong de lie biao zhong gen zong ta men de nei cun kuai 。 shou xian , zhe yang zuo de hao chu shi , lie biao de cha zhao ke yi bian de hen kuai , qi ci , dang dui bei " cui hui " shi , ni ke yi hao wu gu lv di qing chu gen zong lie biao , dan zhe xu yao zai dui chuang jian he shi fang shi jia ru e wai de dai ma lai wan cheng -- ji fen bie she zhi he shan chu dui ying de lie biao 。 ling wai , ni ye ke zhi li yi ge dui nei cun kuai de lie biao ji yi ge dui fan wei de lie biao , bing zai cheng xu kai shi yun xing shi jian li ta men 。    yi xie zhuan ye de yun xing shi fen xi gong ju ye neng dui fen pei de nei cun kuai ji dui fan wei jin xing gen zong , jiu xiang qian mian suo shuo de zi ding yi nei cun fen pei han shu yu shi fang han shu yi yang , shen zhi huan neng tong guo ji ben de xu ni nei cun HASH zhi (ox187d690) jin yi bu gen zong , yi bian wei jing que de yun xing shi cuo wu jian ce ti gong geng jia ke kao de shou duan 。 dan ci chu miao shu de fang fa bing bu zu yi bang zhu ni li jie he shi cai neng zhao dao tong guo cheng xu ke kong zhi de dui nei cun kuai , jian shao xu ni nei cun xiao hao de shi ji 。    zhao dao shi dang de qing li shi ji    wei shi yong gen zong xin xi yi jing que ding wei na xie dao zhi xu ni nei cun bu bi yao zeng chang de dui nei cun kuai , ni huan bi xu yao ji lu xia nei cun fang wen dong zuo , bing zai cheng xu du xie dui nei cun shi , biao ji chu xiang ying de nei cun kuai gen zong jie gou 。 jia ru ni de dui nei cun kuai dou shi tong guo cun qu han shu fang wen de , na me hen qing yi jiu ke zhao dao suo you dai ma du xie de nei cun bu fen , bing yi tiao jian bian yi sheng cheng yi ge te ding de ban ben 。 zhe xie cun qu han shu ke cha zhao ni lie biao shang bei fang wen guo de nei cun kuai , bing she zhi bu er zhi zuo chu biao ji 。    dang xu ni nei cun bei ti jiao sheng cheng yi ge dui , ni de zi ding yi nei cun fen pei han shu ying qu xiao dui zhong suo you nei cun kuai de biao ji , er zai jie xia lai , ta men ke neng hui chong xin bei biao ji shang , yi ge jie yi ge , jiu xiang ni de cheng xu zheng zai fang wen ta men 。 dang yi ge qu xiao biao ji de nei cun kuai bei shi fang shi , xiang ying de xu ni nei cun ye hui bei shi fang , ci shi ni zi ding yi de shi fang han shu jiu hui xian yi bu shi fang nei cun kuai , yi jian xiao xu ni nei cun de fu gai fan wei 。    ye ke an pai dui dui nei cun kuai zuo yi xie lin shi de sao miao , zhe ye xu ke zai mei yi ci xu ni nei cun ti jiao shi jin xing 。 jia ru yi ge nei cun kuai zai jing guo duo bian sao miao hou reng bao chi wei biao ji zhuang tai ( ye xu hui hua hen chang shi jian ), ze bao han ci nei cun kuai de xu ni nei cun fan wei jiu bi xu dui suo gen zong de nei cun kuai shu jin xing jian cha 。 jia ru na ge nei cun kuai , huo zhe yi zu bei hu shi de lei si nei cun kuai , zhi shi dan du di yu ti jiao de xu ni nei cun you guan xi , na me tong guo shi fang yu chong xin ding wei zhe xie nei cun kuai , ni ke neng yi jing zhao dao yi ge jian shao cheng xu xu ni nei cun yao qiu de hao fang fa 。    jia ru ni shi xian le ci chu miao shu de suo you nei cun kuai he dui fan wei gen zong dai ma , er dang zhe xie suo you de gen zong dou qi zuo yong shi , na me cheng xu de su du jiang hui bian de hen man , zhu yao shi yin wei zai mei yi ci dui nei cun fang wen shi , dou hui jin xing yi bian lie biao cha zhao , dang ran , ye ke yi tong guo yi xie kuai su lie biao cha zhao fang fa ru er fen fa cha zhao 、 tiao yue cha zhao zhi lei de lai suo duan cha zhao de shi jian , huan ke shi yong dui ying mei ge dui de dan du lie biao lai jia su cha zhao 。 jia ru cheng xu shi yong le xu duo de dui nei cun kuai , bing qie ye zhao dao le jian shao e wai xu ni nei cun xiao hao de fang fa , yi wang suo hua fei de suo you jing li yu nai xin , yu ci shi de dao de hui bao xiang bi , jiu suan bu shang shen me le 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
情人节的清纯女生(9)
情人节的清纯女生(8)
情人节的清纯女生(7)
情人节的清纯女生(6)
山东蓬莱海边组照
一探哲蚌 II
一探哲蚌 III
古长城的一角
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有