Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
...或者它是否与调用进程共享内存?换句话说,C++ 编译器选项“堆栈保留大小”在编译 DLL 时是否有任何影响?
函数使用其调用者的堆栈(最终在线程创建时确定)。初始线程的堆栈保留大小由主可执行文件的 PE 头设置。附加线程的堆栈大小由 的参数指定CreateThread。DLL 的 PE 标头不会影响这些。
CreateThread
C++ 编译器无论如何都没有这样的选项——许多编译单元中的哪一个将控制初始线程的堆栈大小。这是一个链接器选项。