[dmd-beta] dmd 1.070 and 2.055 beta
Sönke Ludwig
ludwig at informatik.uni-luebeck.de
Mon Sep 5 12:35:27 PDT 2011
Am 05.09.2011 19:54, schrieb Rainer Schuetze:
>
> What OS are you running on?
>
> Your code works for me (XP SP3). Also Visual D works fine AFAICT (its
> a plugin DLL to VS).
>
>
> On 05.09.2011 19:17, Sönke Ludwig wrote:
>> Am 04.09.2011 06:48, schrieb Walter Bright:
>>> http://ftp.digitalmars.com/dmd1beta.zip
>>> http://ftp.digitalmars.com/dmd2beta.zip
>>> _______________________________________________
>>> dmd-beta mailing list
>>> dmd-beta at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>> Has anything changed with regard to TLS?
>>
>> I'm getting OutOfMemoryErrors when accessing TLS arrays from within a
>> DLL. Maybe the dll_fixTLS function in core.sys.windows.dll needs to
>> be adjusted?
>>
>> ---
>> import std.c.windows.windows;
>> import core.sys.windows.dll;
>>
>> int[] s_arr;
>>
>> extern (Windows)
>> BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) {
>> switch (ulReason) {
>> default: return false;
>> case DLL_PROCESS_ATTACH:
>> if( !dll_process_attach( hInstance, true ) ) return false;
>> s_arr ~= 0; // -> OutOfMemoryError
>> break;
>> }
>> return true;
>> }
>> ---
>>
>>
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
>
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
Windows 7 x64 SP1... But it is more complicated than it seemed.
I had another file linked to the DLL that I thought had not effect. But
actually it used a function from another DLL* that was linked in
statically via passing a .lib file to the command line (along with the
source files). The error does not occur if compiling and linking is done
by separate invocations of dmd. Also commenting out all the lines that
use a function from the external DLL fixes the problem.
(* that DLL is LLVM 2.9, so no D code inside)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20110905/abc111d5/attachment.html>
More information about the dmd-beta
mailing list