亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mainpage

?? vdhl and matlab, i think it good for you
??
字號:
/*! \mainpage<h3>pool: Pooled memory allocation class</h3><h4>Overview</h4><p>Many programs, especially compilers and 3D graphics programs, allocatelarge complex data structures.  For example, a compiler will allocatelists of abstract syntax trees that represent the statements in aprogram.  These trees will be decorated with symbol and typeinformation.</p><p>When processing is complete, dynamically allocated data structuresmust be deallocated.  Calling the C++ delete function for every objectcan be very time consuming.  The pool allocator allows memory to berapidly deallocated.  Memory is allocated in large pools which requireonly a few calls to return to the operating system.</p><h4>Memory Pool Algorithm</h4><p>Each <b>pool</b> object allocates a unique memory pool from a list ofmemory pools (see the global variable <b>memory_pools</b>, which isan instance of the mem_pool template).  The pool is allocated in theclass constructor and deallocated in the destructor.  Since theconstructor and destructor allocate and deallocate pools, the copyconstructor is not allowed.  An attempt to use the copy constructorwill result in a compile time error, since the copy constructor is<i>private</i>.</p><p>The skeleton of the pool class is shown below.  The <b>pr</b> memberfunction prints information about the memory allocation pool.</p><pre>class pool {private:// The copy constructor for this class should never be called,// so declare private    pool( const pool &p) {}public:    pool(void);    ~pool(void);    void *GetMem( unsigned int num_bytes );    void pr( FILE *fp = stdout );};</pre><h3>Overloading New in C++</h3><h4>Pooled Memory Allocation</h4><p>Most large C++ programs make use of dynamically allocated memory.This is especially true of EDA applications (simulators andtools for VLSI chip design), where the designer cannever safely set an upper limit on application size.  In many caseslarge amounts of dynamically allocated memory is consumed byinterconnected objects which are not themselves very large.  The timeconsumed allocating objects can be minimized, but is unavoidable.  Asignificant amount of processing time can also be consumed traversingthe dynamic data structures and returning them to the system using thedefault C++ delete function.  Time consuming memory recovery can beavoided by using a pool based memory allocator.</p><p>A pool based memory allocator allocates large blocks of memory andthen allocates smaller objects from these blocks.  When it is timeto recover memory, the entire pool is deallocated at once.  Thisusually involves returning only a few large memory blocks to thesystem.  This greatly reduces the time consumed by memory recovery.</p><h4>Object Allocation and Initialization</h4><p>If a C++ object is allocated from a memory pool, its constructor willnot be called by default.  This can sometimes be handled byinitializing the object with an explicit call to the constructor.For example:</p><pre>  my_class *pMyClass;  pMyClass = (my_class *)pool.GetMem( sizeof( my_class ) );  *pMyClass = my_class();  <i>// invoke the constructor</i></pre><p>This approach has several problems.  The constructor invokation abovecreates a temporary instance of the class <i>my_class</i>.  This classis then copied into the memory pointed to by <TT>pMyClass</TT>.  Afterthe class is copied, the destructor for <i>my_class</i> will becalled.  If memory allocation takes place in the constructor anddeallocation takes place in the destructor, there can be a problem.For example, if the class pointed to by <TT>pMyClass</TT> isinitialized with a pointer the memory allocated by the <i>my_class</i>constructor, this same memory will be deallocated by the destructor.When the assignment completes, the class pointed to by<TT>pMyClass</TT> will point to deallocated memory, which is not whatthe programmer intended.</p><p>The problem above can be handled by adding <TT>init</TT> and<TT>dealloc</TT> class functions which can be called explicitlyto allocate memory.  For example, the <TT>init</TT> function canbe called after the class constructor copy.</p><p>Unfortunately, the scheme outlined above is totally inadequateif the class have virtual functions.  The class constructor willnot initialize the virtual function table with the appropriatefunction addresses.</p><h4>Overloading New</h4><p>Since at least 1993 C++ has defined a way to overload the<b>new</b> operator.  This provides a simple and natural way toallocate an object from a memory pool and initialize it properly.  Theoverloaded <b>new</b> function allocates memory from the memory pooland the C++ compiler generates code to initialize the virtual functiontable and to invoke the class constructor.  </p><p>The C++ code below has a base class (cleverly named <i>base</i>)and a derived class <i>base_one</i>.  The base class has anoverloaded version of new, which takes two arguments: the numberof bytes to allocate and a pointer to a memory pool allocationobject.  The compiler automatically plugs in the type size(the first argument to the overloaded <b>new</b>).  The callto <b>new</b> then takes the form</p><pre>    pClass = new( <i>user args</i> ) <i>type</i></pre><p>which is expanded into a call to the overloaded new function</p><pre>    void *operator new( <i>type size</i>, <i>user args</i> );</pre><p>For more details see section 5.3.3 of the ANSI C++ standard.<pre>class base {public:    base() { }    void *operator new( unsigned int num_bytes, pool *mem)    {	return mem->GetMem( num_bytes);    }    virtual void pr(void) = 0;};class base_one : public base {private:    int a;public:    base_one() {}    void pr(void)     {       // local print    }};main(){    base *pB1;    pool mem;    pB1 = new( &mem ) base_one;    pB1->pr();}</pre><h3>strtable: string table class</h3><h4>Overview</h4><p>The string table (<b>strtable</b>) guarantees that all strings in thestring table are unique.  For example, if the <b>find_string</b>function is called twice for the same string, the string will bestored once.  The second call will return the address of the firststring stored.</p><p>If two strings are stored in the string table, they can be compared bycomparing their addresses, since all strings in the table are unique.If the addresses are the equal, the strings are the same string.</p><p>The string table classes stores strings that are packaged in theSTRING class (see str.h).</p><h4>Hash Algorithm</h4><p> The <b>strtable</b> class is a hash table that can store anunlimited number of strings, since the hash table uses collisionlists.  As with any hash table of this sort, as the number of stringsheads toward infinity, the performance of the hash table will becomethat of a linked list.  </p><p>In practice the performance of this hash table depends on the tablesize.  In order to minimize the amount of memory used by a mostlyempty table, the <b>strtable</b> class is based on a sparse arraybackbone.  The size of the sparse array is given in the<b>strtable</b> constructor.  This size given to the constructorwill be rounded to the nearest power of two.  The total size ofthe hash table is the square of the initialization size.  So ifthe <b>strtable</b> constructor is passed 1024, the total tablesize will be 1024 * 1024, or 1 million hash chains.</p><p>The sparse array is initially empty.  When an element is added, anarray of, in this case, 1024 elements will be added.  At this pointarray elements 0..1023 will be present.  If a hash element is addedoutside this range, another 1024 elements will be added.</p><h4>Performance</h4><p>This hash table has been tested with the <ahref="http://www.best.com">best.com</a> on line dictionary.  Thisdictionary consists of about 250K words.  When this dictionary isentered in the has table, the sparse array is 99 percent allocated.That is, almost all of the 1024 element arrays linked into the 1024element back bone have been allocated.The longest hash collision chain is 7 elements.</p><h4><i>strtable</i> constructor</h4><p>The <b>strtable</b> constructor is passed two arguments:</p><ul><li>The hash backbone size</li><li>The address of memory allocation pool object</li></ul><p>For example:</p><pre>  pool pool_obj;  strtable string_table(1024, &pool_obj );</pre><p>When a string is entered into the string table, it willbe copied.  The memory allocation object is used toallocate storage for the string.  The hash table andthe collision lists are allocated via the C++ <i>new</i>function.  The <b>strtable</b> destructor will deallocatethe hash table and collsion lists.  However, the user isresponsible for deallocating the memory for the strings.</p><p>The skeleton of the string table class is shown below:</p><pre>class strtable : public hash_services {public:    strtable( unsigned int size, void *(*GetMem)(unsigned int));    void dealloc();    ~strtable();    STRING find_string( STRING item, Boolean insert = TRUE);    STRING find_string( const char *str, Boolean insert = TRUE );    unsigned int get_max_list(void);    void pr(void);    //    // The functions first and get_item are used to iterate through the    // string table.  Note that the strings will be returned in hash order,    // which is pseudorandom.  An example is shown below:    //    //   STRING str;    //    //   for (str = strtab.first(); str.GetText() != NULL; str = strtab.get_str()) {    //       printf("%s\n", str.GetText() );    //   }    //    STRING first(void);    STRING get_str(void);}; // class hash_label</pre> */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类人妖一区二区av| 国产精品一区二区91| 99久久久无码国产精品| 青青草一区二区三区| 亚洲精品国产品国语在线app| 久久九九影视网| 久久青草国产手机看片福利盒子 | 亚洲男人天堂av| 国产精品久久久久一区二区三区 | 日韩美女啊v在线免费观看| 日本一区二区三区免费乱视频| 日韩欧美亚洲国产精品字幕久久久| 制服丝袜亚洲精品中文字幕| 欧美一卡二卡三卡| 日韩免费一区二区| 综合电影一区二区三区| 亚洲欧美日韩中文字幕一区二区三区| 亚洲视频一区在线观看| 亚洲国产wwwccc36天堂| 五月天久久比比资源色| 国产中文一区二区三区| 大胆亚洲人体视频| 在线观看亚洲一区| 91精品国产91综合久久蜜臀| 久久夜色精品一区| 亚洲丝袜制服诱惑| 欧美96一区二区免费视频| 国产激情一区二区三区四区| 色综合咪咪久久| 91精品国产免费| 久久久久国产精品厨房| 亚洲男同1069视频| 久久精品免费观看| 一本色道**综合亚洲精品蜜桃冫| 7777精品伊人久久久大香线蕉最新版 | 成人av电影观看| 精品视频一区二区三区免费| 精品国产成人在线影院| 亚洲欧洲www| 久久国产人妖系列| 日本久久一区二区三区| 精品美女一区二区三区| 亚洲人亚洲人成电影网站色| 激情综合色丁香一区二区| 91香蕉视频mp4| 精品1区2区在线观看| 亚洲精品一卡二卡| 国产一区二区在线影院| 91福利精品第一导航| 久久精品亚洲麻豆av一区二区| 亚洲一区二区三区小说| 岛国精品一区二区| 欧美xxx久久| 爽好多水快深点欧美视频| 97久久精品人人做人人爽50路| 日韩亚洲国产中文字幕欧美| 亚洲综合丝袜美腿| 99久免费精品视频在线观看| 久久免费午夜影院| 日本女人一区二区三区| 91成人看片片| 国产精品久久久久久久浪潮网站 | 国产一区二区三区在线观看免费 | 成人av免费网站| 亚洲午夜在线视频| 国产精品久久久久久久午夜片| 久久99精品国产麻豆婷婷洗澡| 日本亚洲免费观看| 91麻豆国产在线观看| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲综合免费观看高清完整版| 国产91精品欧美| 国产午夜亚洲精品羞羞网站| 久久不见久久见中文字幕免费| 欧美剧在线免费观看网站 | 久久久亚洲欧洲日产国码αv| 日本在线不卡视频一二三区| 欧美日韩一区二区不卡| 亚洲一区成人在线| 欧美美女直播网站| 丝瓜av网站精品一区二区| 欧美丰满少妇xxxxx高潮对白| 一区二区成人在线观看| 欧美又粗又大又爽| 亚洲成av人**亚洲成av**| 欧美高清www午色夜在线视频| 亚洲二区在线观看| 91精品国产91久久久久久最新毛片 | 欧美日韩精品欧美日韩精品| 亚洲成年人影院| 日韩欧美国产三级| 成人av电影在线| 亚洲视频一区二区在线| 色狠狠桃花综合| 亚洲一区二区3| 制服丝袜一区二区三区| 国产精品性做久久久久久| 中文字幕av一区二区三区高| caoporn国产一区二区| 亚洲一二三四久久| 欧美成人vps| 色吧成人激情小说| 免费成人av在线播放| 久久久不卡网国产精品二区| 97久久人人超碰| 久久99精品久久久久婷婷| 国产精品沙发午睡系列990531| 91国偷自产一区二区开放时间| 亚洲大型综合色站| 久久久三级国产网站| 色综合天天在线| 久久99久久99精品免视看婷婷 | 欧美日韩亚州综合| 国产乱人伦偷精品视频免下载 | 久久久99精品久久| 欧美日韩精品三区| 成人精品国产福利| 男男视频亚洲欧美| 亚洲欧美日韩一区二区 | 亚洲精品日韩综合观看成人91| 欧美精品18+| 99久久国产综合色|国产精品| 美女网站色91| 亚洲国产cao| 亚洲欧美一区二区在线观看| 日韩欧美国产高清| 欧美日韩三级在线| 91亚洲精华国产精华精华液| 国产综合色精品一区二区三区| 亚洲亚洲人成综合网络| 欧美激情一区二区在线| 日韩免费电影一区| 欧美日韩日日夜夜| 色狠狠一区二区| 91在线观看成人| 成人在线视频一区二区| 国产一区二区三区免费播放| 丝袜美腿亚洲综合| 综合在线观看色| 国产精品每日更新在线播放网址| 91精品国产aⅴ一区二区| 在线免费av一区| 一本久久精品一区二区| 成人国产在线观看| 国产精品一区二区久久精品爱涩 | 麻豆精品一区二区av白丝在线| 亚洲色图丝袜美腿| 亚洲国产精品ⅴa在线观看| 久久久亚洲精品一区二区三区| 精品奇米国产一区二区三区| 日韩三级在线免费观看| 欧美一区二区三区精品| 在线亚洲人成电影网站色www| 91在线一区二区| eeuss鲁片一区二区三区在线看| 国产成人激情av| 成人高清在线视频| 99视频精品在线| 91成人免费在线| 欧美视频完全免费看| 国产精品区一区二区三区| 中文字幕高清不卡| 中文字幕欧美一区| 亚洲欧美色综合| 亚洲综合精品自拍| 亚洲午夜精品在线| 日韩福利电影在线| 国产一区二区三区在线观看免费 | 国产精品久久三| 中文字幕在线免费不卡| 亚洲久本草在线中文字幕| 国产麻豆一精品一av一免费| 51久久夜色精品国产麻豆| 精品免费日韩av| 国产精品美女视频| 亚洲一区二区三区四区不卡| 老司机免费视频一区二区三区| 国产精品影视在线观看| 日韩写真欧美这视频| 91麻豆精东视频| 欧美视频中文一区二区三区在线观看| 欧美亚洲国产怡红院影院| 91麻豆精品国产91久久久久 | 精品一区二区三区不卡| 国产91丝袜在线播放0| 在线观看欧美黄色| 精品成人私密视频| 亚洲欧洲精品天堂一级| 午夜精品一区二区三区免费视频 | 欧美xfplay| 亚洲免费观看高清在线观看| 欧美色偷偷大香| 亚洲柠檬福利资源导航| 欧美亚洲一区二区在线| 亚洲免费观看高清完整版在线| 精品噜噜噜噜久久久久久久久试看 | 久久综合av免费| 国产精品久久久久久久久久久免费看 | 成人午夜激情视频| 91蜜桃在线观看|