Part 1ArticleStl_deque's design philosophy and STL memory management are explained in a rough way. At least we can see the tip of the iceberg.
In this article, I will refine the analysis of vector and analyze some functions in detail. In some cases, it is better to clarify some problems.
Open the source code of stl_vector and find that the design idea of the vector is exactly the same as that of stl_deque. It is reasonable to think about it and maintain the consistency of implementatio
One, the Space Configurator standard interfaceSee "STL Source Code Anatomy" Chapter II-2.1.Ii. SGI Space Configurator with sub-configuration forceSGI STL's Configurator differs from the standard specification by its name alloc rather than allocator, and does not accept any parameters (although SGI also defines a configurator that conforms to some standard, named Sllocator,
Http://gamedev.csdn.net/n/20060921/95047.html
SGI, a veteran graphics company, is gradually gaining momentum. its restructuring plan has been approved by judges and is expected to get rid of the Protection of chapter 1 of the bankruptcy law next month.
In the face of competitors such as IBM, HP, sun, and Dell, SGI has been moving forward in recent years. At the beginning of the year, it was even more li
As mentioned in the previous article, the Concepts Check in sgi stl is actually a feature that will be checked during compilation by using template class instantiation. sgi stl is widely used.
Concepts Check, as mentioned earlier, is not mentioned here. in
Template features are divided into two types: 1. Absolute features
2. Some Features
In this blog post, we mainly look at some special features. We s
OpenGL sdks on Windows platforms are implemented by Microsoft, and SGI also implements a set of OpenGL sdks. Some friends on the Internet say that SGI's OpenGL is good, so I had the idea of installing OpenGL for SGI, so I had this article.I. Objective: To install SGI OpenGL on Windows and make windows OpenGL and SGI op
From the holiday to the present, I haven't touched STL source code for a long time. During the time I went home, I learned Lua. Lua had less learning materials and sent some time.
About Lua'sArticleYou can only say that you have time to talk about it. If you are okay, you can play with QT. The article will be added later.
I slept for a whole day yesterday and went to the network center in the evening. I sat down in the familiar environment, but I still couldn't escape from my heart.
Tha
SGI and NASA jointly announce that NASA's intanium 2 processor-based Columbia supercomputer is the world's fastest computer:
"IBM Inc. just refreshed NEC two weeks ago and maintained its supercomputer speed record for two years, but its record was refresh by SGI again.
SGI announced on Tuesday, local time that it was sold to the National Aviation and Space Ad
// File: 6numeric. CPP # include
This code is taken from STL source code analysis p298, but cannot be compiled. There are two compilation errors.\ P298 \ main. cpp | in function 'int main () ': |\ P298 \ main. cpp | 42 | error: 'power' was not declared in this scope |\ P298 \ main. cpp | 46 | error: 'iota 'was not declared in this scope |\ P298 \ main. cpp | 47 | warning: Comparison between signed and unsigned integer expressions || === Build finished: 2 errors, 1 warnings ===|The warning is ob
To further understand the operating principles of Allocator, we use the following as an example to explain its implementation details.
STD: Allocator
Myall. Allocate (10 );
The above code calls sgi stl Allocator and allocates 10 int-type space. The following analysis uses the sgistl source code allocator. cpp and adds my understanding comments. It is recommended that you refer to Hou Jie's book for more information. However, the actual version I curr
the power function of the SGI STL is used to calculate the nth exponent of a number, such as the n power n for x.= -( -Binary10100) 1 0 1 0 0 -=2^4+2^2x^ -= x^ ((2^4) + (2^2)) = x^ (2^4) * x ^ (2^2) Part2 Part1templateclass_TP,class_integer,class_monoidoperation>_tp __power (_tp __x, _integer __n, _monoidoperation __opr) {if(__n = =0) returnidentity_element (__OPR); Else { while((__n 1) ==0)
Sgistl default use of the two-level space Configurator, when the need to configure the chunk is greater than bytes when SGI STL calls the first-level space Configurator, the allocate function of the first-level space Configurator allocates memory directly using malloc, and the DEALLOCATE function frees memory directly using free. SGI STL calls a level two space Configurator when the chunk that needs to be c
Because both of the two projects that have recently been involved are in the phase of acceptance, the two days are idle, and the rest is a small project that the new personnel are required to do in the room, at present, there are mainly differences in the interface beautification of MFC. I am not very interested in this, so I am not planning to spend time on it. Looking down on the sgi stl source code, it seems that
Preface:
Learning C ++ is now the ninth day, so I just have a simple understanding of C ++ theoretically. I have no practical experience in practical application. so next we will analyze the sgi stl source code.Article, More
This is just a direct analysis of the source code, and there is no experience on the actual application scenario. So we only talk about the source code, and nothing else.
For Hou Jie's article
I have referenced some good
Parse sgi stl function static void (* _ set_malloc_handler (void (* _ f )()))()
static void (* __set_malloc_handler(void (*__f)()))(){ void (* __old)() = __malloc_alloc_oom_handler; __malloc_alloc_oom_handler = __f; return(__old);}
First, you must know the function expression of the function pointer as the parameter and the return function pointer (see FunctionPointer ).Therefore, void (* set_malloc_handler () indicates that set_malloc_hand
It took almost one day to implement the string of sgi stl to the c ++ standard.ProgramLibrary. Now, let's make a summary.
String is also one of many containers. It complies with the container design interface and is a random reading container (similar to vector, that is, the memory structure is simpler). Its own iterator design is similar to that of vector, all use passed type pointers for iterative operations. String data is stored directly in Alloc
In fact, the question is a bit of an eye-catching, mainly to express the question of two points in the chunk_alloc function. I would like to ask you how to understand these two points.
The following describes the chunk_alloc code implementation, and describes the functions of the function and the functions of each code.
The memory configurator of SGI is divided into two layers: the first layer calls malloc directly, and the second layer is allocated b
. Therefore, it is decided to analyze the principle of the thorough STL space Configurator and realize it. Design Philosophy
I chose the SGI version of the STL, later also are directly called STL, do not distinguish. This version of the philosophy of design is: application space to System heap consider multithreaded state (I'm only concerned about the principle of space configuration, not care about this) considering the contingency measures in the ca
1 iterator-related types of extraction (iterator_traits)
Many algorithms, such as lookups, pointer movements, and so on, all pass through iterators, while the types of different iterators determine the difference in their algorithmic operating
Today, I re-read "STL source code analysis", so I can't help but admire the classic design of STL. The STL space adaptation code design is particularly incisive, not only considering the hidden danger of memory fragmentation, but also considering
Today again read the "STL Source code Analysis", can not help but praise STL Design classic. STL Space adaptation code design is particularly incisive, not only take into account the hidden trouble of memory fragments, but also take into account the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.