我的文章

我的文章


联络方式

FoldUnfold Table of Contents Microblog IM Microblog Twitter: http://twitter.com/xushiwei (@xushiwei) Buzz: http://www.google.com/profiles/xushiweizh#buzz Sina: http://t.sina.com.cn/xushiweizh/ IM Gtalk/Email: xushiweizh (at) gmail (dot) com MSN: xswzh (at) hotmail (dot) com

C++ Memory Management Innovation: GC Allocator

FoldUnfold Table of Contents Introduction What is GC Allocator? Concept of GC Allocator A Better Smart Pointer Creating a GC Allocator and Allocating Memory Should Be Very Fast Another Way of GC GC Allocator Implementations: ScopeAlloc and AutoFreeAlloc Faster Than All Allocators You Ever Seen The Infrastructure of ScopeAlloc and AutoFreeAlloc GCAlloc: A Huge Stack No Multithreaded Locks When to use AutoFreeAlloc Open Source Applications based on GC Allocator A Word File Writer Rope based on GC Allocator STL Containers based on GC Allocator Related Topics To obtain a copy of this paper in pdf format click here (or from google code). Another copy is also available on codeproject in html format. Introduction Most of the C++ programmers do not benefit from Garbage Collection technique...

GC Allocator Summary

FoldUnfold Table of Contents C++ Memory Management Innovation: GC Allocator A Word File Writer Rope based on GC Allocator STL Containers based on GC Allocator The Fastest Word File Writer C++ Memory Management Innovation: GC Allocator Link: http://www.codeproject.com/KB/cpp/gc-allocator.aspx Highlights: The tiniest, fastest allocator and easy to use. And it became a boost sandbox library on 2008-04-29. I'm preparing for a peer review. It is easy to use: Like GC languages (eg. Java, C#, etc), it is no need to delete allocated objects by using GC Allocator. It is faster than all allocators you ever seen: For the detail information about the comparison, see Allocators Performance Comparison . Why GC Allocator is so fast? It benefits from: Its good allocation algorithm. No...

Allocators Performance Comparison

FoldUnfold Table of Contents Summary Test Cases Test Result on Linux Condition 1: Each allocator allocates one integer object Condition 2: Each allocator allocates 1000 integer objects Condition 3: Each allocator allocates 1000,000 integer objects Test Result on Windows Condition 1: Each allocator allocates one integer object Condition 2: Each allocator allocates 1000 integer objects Condition 3: Each allocator allocates 1000,000 integer objects Conclusion Summary In this article we'll talk about allocators performance. We take performance comparison of: AutoFreeAlloc ScopeAlloc APR Pools (Apache Portable Runtime) MT Allocator (GNU C++) Boost Pool (boost::pool) Boost ObjectPool (boost::object_pool) NewDelete (new/delete) Because most of allocators focus to improve performance of...

Dive into GC Allocator


A Proposal to Cancel Overriding the DEFAULT operator new/delete

FoldUnfold Table of Contents Motivation Impact on the Standard Proposed Text Motivation I don't think we need to override the DEFAULT operator new/delete. This makes your code doesn't work well together 3rdparty code (if it also overrides them). Why overriding the DEFAULT operator new/delete is bad? Allowing to override the DEFAULT operator new/delete means the DEFAULT operator new/delete are special operators. When we have more than one implementations of an operator, the compiler/linker will report a redefining error. However, it allows there are two implementations of the DEFAULT operator new/delete (one of them is implemented as default). It sounds good. But, This gives a hint that there may have many implementations of the DEFAULT operator new/delete. When this happens, the...

A Proposal of operator new with typeinfo

FoldUnfold Table of Contents Motivation Impact on the Standard Design Decisions operator new with typeinfo operator new[] with typeinfo Issues for Discussion I. Corresponding operator _delete Applications based on operator new with typeinfo I. A Debug Version of operator new II. A Region Allocator Proposed Text Motivation At present we can override operator new as follows: void* operator new(size_t size, ArgT1 arg1, ArgT2 arg2, ...) { return malloc(size); // just an example } Even though it is good enough, still I think something is missing here. For example, if I want to implement a debug version of operator new which reports the memory leak and the kind of objects leaked, I cannot get the class name of an allocated object. An operator new with typeinfo can solve this...

The Fastest Word File Writer

FoldUnfold Table of Contents Highlights Why it is fast? Full-featured Taking a fast look A better COM About the download resources Performance Highlights It's a fast, full-featured word file format writer. And It also can write RTF files (but I remove this function in the published version provided here). And this version is only for technology show. You can't use it in commercial way. Why it is fast? First, we use GC Allocator to accelerate memory allocation. Second, we create a DOM tree which its internal data structures is similar to word file format. It provides powerful APIs and reduces IO times. Full-featured Yes. it can write all word2003 functions such as rich text, font/stylesheet, bullet/list, header/footer, footnote/endnote, fields, bookmark, annotation, frame, table,...

Rope based on GC Allocator

FoldUnfold Table of Contents Introduction Source code Performance Comparison Introduction Rope is a complex string implementation with scaled performance. The original rope implementation is appeared SGI STL. I rewrite the rope class based on GC Allocator. Code size is much reduced and performance is better. Source code Source code of the original rope implemention: stl_rope.h ropeimpl.h Rope based on GC Allocator: RopeRep.h Rope.h RopeImpl.h RopeIter.h CharProxy.h SequenceBuffer.h I divided rope source code into six parts: RopeRep.h implements the underlying representation of rope data structure. RopeIter.h implements rope's iterators. CharProxy.h implements element reference proxy of rope containers. Rope.h/RopeImpl.h implements the rope class. SequenceBuffer.h implement...

page 1 of 212next »
Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License