What is a stack imbalance?

后端 未结 2 863
孤城傲影
孤城傲影 2021-01-06 23:33

Having read this article F# Versus Mathematics: Part One - Getting Started with BLAS and LAPACK I stumbled across the term stack imbalance in the paragraph

2条回答
  •  猫巷女王i
    2021-01-07 00:17

    We just saw this the other day (marshalling with c# and c++)

    I refer you to the text from an MSDN page:

    The pInvokeStackImbalance managed debugging assistant (MDA) is activated when the CLR detects that the stack depth after a platform invoke call does not match the expected stack depth, given the calling convention specified in the DllImportAttribute attribute as well as the declaration of the parameters in the managed signature.

    I realize this is for a specific compiler warning but the page gives some info on what a stack imbalance is, what causes it, what the symptoms are, and how to resolve it. As Daniel said it's typically due to the signatures of the managed and unmanaged not matching.

    Hope this helps.

提交回复
热议问题