CodePudding user response:
Defer are commonly used to release resources, causal relationship after the allocation of resources is likely to depend on the front of the resources, if the first release is dependent on resources can be a problem, so the other way around won't destroy the dependencies.CodePudding user response:
Because it is the structure of the stack, FILO, so will be the reverseCodePudding user response:
Defer statement is provided in the language used to register a delay call mechanism, it can make function in executed after the completion of the current function, its implementation is to defer statements and parameters into the stack, so is the reverse,CodePudding user response:
Behind the definition of function may depend on the front of the resources, so want to perform first, if the previous execution, first released this dependence, that behind the dependence function will not be able to find it,CodePudding user response:
Order will not need to defer, direct order to the right and then perform the defer function not good?Defer, therefore, when someone is afraid of order to finally forget to perform the defer to do processing, and then do the treatment mentioned in front, use a defer to control again before execution, so that each layer of the defer all meet the layer defer control (each layer at the end of the adjustable defer), so the inner defer will call first, and then the outer defer calls, in turn opens outward until the outermost defer the last call,