Re: alloca without runtime?

2017-05-10 Thread via Digitalmars-d-learn
On Wednesday, 10 May 2017 at 20:25:45 UTC, aberba wrote: On Thursday, 4 May 2017 at 14:54:58 UTC, 岩倉 澪 wrote: On Thursday, 4 May 2017 at 12:50:02 UTC, Kagamin wrote: You can try ldc and llvm intrinsics http://llvm.org/docs/LangRef.html#alloca-instruction

Re: alloca without runtime?

2017-05-04 Thread via Digitalmars-d-learn
On Thursday, 4 May 2017 at 12:50:02 UTC, Kagamin wrote: You can try ldc and llvm intrinsics http://llvm.org/docs/LangRef.html#alloca-instruction http://llvm.org/docs/LangRef.html#llvm-stacksave-intrinsic Ah, yep! pragma(LDC_alloca) void* alloca(size_t); This appears to work with ldc. It

Re: alloca without runtime?

2017-05-04 Thread via Digitalmars-d-learn
On Sunday, 30 April 2017 at 05:07:31 UTC, 岩倉 澪 wrote: I've been playing around with using D with no runtime on Linux, but recently I was thinking it would be nice to have an alloca implementation. I was thinking I could just bump the stack pointer (with alignment considerations) but from what

alloca without runtime?

2017-04-29 Thread via Digitalmars-d-learn
I've been playing around with using D with no runtime on Linux, but recently I was thinking it would be nice to have an alloca implementation. I was thinking I could just bump the stack pointer (with alignment considerations) but from what I understand compilers sometimes generate code that

Re: The Mystery of the Misbehaved Malloc

2016-07-29 Thread via Digitalmars-d-learn
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 Mystery of the Misbehaved Malloc

2016-07-29 Thread via Digitalmars-d-learn
So I ran into a problem earlier - trying to allocate 2GB or more on Windows would fail even if there was enough room. Mentioned it in the D irc channel and a few fine folks pointed out that Windows only allows 2GB for 32-bit applications unless you pass a special flag which may or may not be a

Re: Create Windows "shortcut" (.lnk) with D?

2016-03-06 Thread via Digitalmars-d-learn
On Sunday, 6 March 2016 at 11:00:35 UTC, John wrote: On Sunday, 6 March 2016 at 03:13:23 UTC, 岩倉 澪 wrote: IShellLinkA* shellLink; IPersistFile* linkFile; Any help would be highly appreciated as I'm new to Windows programming in D and have no idea what I'm doing wrong! In D,

Re: Create Windows "shortcut" (.lnk) with D?

2016-03-05 Thread via Digitalmars-d-learn
On Sunday, 6 March 2016 at 05:00:55 UTC, BBasile wrote: If you don't want to mess with the Windows API then you can dynamically create a script (I do this in CE installer): This might be an option but I'd prefer to use the Windows API directly. I don't know vb script and maintaining such a

Create Windows "shortcut" (.lnk) with D?

2016-03-05 Thread via Digitalmars-d-learn
I'm creating a small installation script in D, but I've been having trouble getting shortcut creation to work! I'm a linux guy, so I don't know much about Windows programming... Here are the relevant bits of code I have: import core.sys.windows.basetyps, core.sys.windows.com,