The Mystery of the Misbehaved Malloc

岩倉 澪 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 29 22:28:02 PDT 2016


On Saturday, 30 July 2016 at 05:21:26 UTC, ag0aep6g wrote:
> 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.

bah, I'm an idiot! CASE CLOSED. Thanks for the help :P


More information about the Digitalmars-d-learn mailing list