Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is __alldiv?

I receive error reports with a Division by zero crash, and the crash occurs at a function called __alldiv. This function is not called anywhere in my code, I searched for it with Find in files.

like image 856
sashoalm Avatar asked Oct 27 '25 10:10

sashoalm


2 Answers

__alldiv is the function from Visual Studio C runtime library which handles 64-bit integer division in 32-bit environment, it looks similar to this: http://www.jbox.dk/sanos/source/lib/lldiv.asm.html

like image 72
Igor Korkhov Avatar answered Oct 30 '25 00:10

Igor Korkhov


__alldiv is MSVC's integer division function.

When you emit an integer division in your code, it doesn't always map one-to-one to the div or idiv assembly instruction. This is due to differences between the language specified behavior and the actual behavior of the div and idiv instructions.

Therefore MSVC invokes a function call to its own integer division function.

like image 39
Mysticial Avatar answered Oct 30 '25 01:10

Mysticial



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!