I have learned how the C + + exception handling mechanism works especially, where the exception object is stored And how does it spread through many scope till the time of the cache? Is it stored in some global area?
Since it can be a compiler, can anyone explain what it is in terms of the G ++ compiler suite?
Implementation can vary, but there are some basic ideas that follow the requirements.
Exception object is an object created in a function, which has been destroyed in the caller. Therefore, it is generally not possible to create an object on the stack. On the other hand, many exception items are not very large, so if a big exception object is really necessary, then a 32 byte can create overflow for buffer and heap.
For the actual transfer of control, two strategies exist. One is to enter enough information in the stack to open the stack; it is basically a list of destroyer to run and the exception handler which can catch the exception. When an exception occurs, then run the stack back to execute those killers, unless you can not catch a match.
The second strategy takes this information into the tables outside the stack. Now, when there is an exception, the call stack is used to find out which scopes have been recorded but if they do not go out they are seen in static tables, where it is determined that throw How the exceptions will be handled, and which methods will run between. This means that the less exception on the stack is overhead; The return addresses are necessary anyway, the tables are extra data, but the compiler can put them in a demand-loaded segment of the program.
Comments
Post a Comment