TAILIEUCHUNG - Expert C++/CLI .NET for Visual C++ Programmers phần 10

Kêu gọi Vứt bỏ và một finalizer trên cùng một đối tượng có khả năng sẽ kết thúc để làm sạch hai lần, và sẽ còn tiêu cực ảnh hưởng đến hiệu suất. Như bạn có thể thấy trong các mẫu mã trước đó, trình biên dịch ghi đè lên hệ thống:: Đối tượng:: Hoàn thiện. nếu thực sự là thông qua, và chức năng quyết toán | 292 CHAPTER 12 ASSEMBLY STARTUP AND RUNTIME INITIALIZATION called by _CorDllMain. In the following explanations I will call this entry point the mixed-code DLL s native entry point. The mixed-code DLL s native entry point is managed in the CLR header of an assembly. The following command line can be used to show the CLR header of the mixed-code dumpbin clrheader If you execute this command you will see the following output Microsoft R COFF PE Dumper Version Copyright C Microsoft Corporation. All rights reserved. Dump of file File Type DLL clr Header 48 cb runtime version 31D0 10 flags 3480 RVA size of 13EC entry point 100013EC 0 0 RVA size of 0 0 RVA size of 0 0 RVA size of 6650 18 RVA size of 0 0 RVA size of 0 0 RVA size of MetaData Directory Resources Directory StrongNameSignature Directory CodeManagerTable Directory VTableFixups Directory ExportAddressTableJumps Directory ManagedNativeHeader Directory The mixed-code DLL s native entry point that the linker has chosen for is __DllMainCRTStartup. As discussed in the context of native DLLs this is the function that is responsible for initializing and uninitializing the CRT. Due to this function call the global variable in is initialized. Furthermore DllMainCRTStartup forwards calls to DllMain which can be used by programmers to extend the native initialization and uninitialization. The next section discusses restrictions for DllMain in mixed-code assemblies. Custom Startup Logic and Load-Time Deadlocks DllMain in native as well as mixed-code DLLs must be implemented with special care. If you do not follow certain rules a deadlock can occur while a DLL is being loaded. DllMain is called either directly or indirectly via the DLL s PE entry point. Before calling the PE entry point of a DLL the operating system s image loader acquires a special critical section with the famous name loader lock. This loader lock can affect the PE entry point itself as well

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.