The Mystery of the Misbehaved Malloc

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 29 22:21:26 PDT 2016


On 07/30/2016 07:00 AM, 岩倉 澪 wrote:
>         auto mem = malloc(2^^31);

2^^31 is negative. 2^^31-1 is the maximum positive value of an int, so 
2^^31 wraps around to int.min.

Try 2u^^31.


More information about the Digitalmars-d-learn mailing list