Retrieve base type of an array (D2)

2009-07-08 Thread AxelS
Here I created a template for getting an arrays base type. I also made the std.string.replaceSlice function accessible with wstrings. May someone could use it or integrate it into phobos... (module std.traits) template ArrayBaseType(A : E[],E) { alias E ArrayBaseType; } (module std.str

Re: How to release memory? (D2.0.30)

2009-07-05 Thread AxelS
@downs: That's what I even had beforejust allocate and release memory is not difficult - just if you want to access the data the GC copies all the memory into its heap... I found a new way which is really good and easy: Just use the Win32 Memory API for allocating and releasing your data wi

Re: How to release memory? (D2.0.30)

2009-07-04 Thread AxelS
@Ary Borenszweig: Good idea but I can't pipe data to a HTTP-server located somewhere in the internet... OK, I tried it with C's malloc and free - but everytime I access my array, D puts the memory into its heap...I'm getting crazy because of this! ubyte[] data=cast(ubyte[])malloc(50_000_000)[0

Re: How to release memory? (D2.0.30)

2009-07-04 Thread AxelS
BCS Wrote: > You can't. The D runtime (and most other runtimes) don't ever reduce the > amount of memory they keep in the heap. If you where to allocate another > 25MB right after that function you would see no change in the memory usage. > The good news is that with virtual memory, all of that

How to release memory? (D2.0.30)

2009-07-03 Thread AxelS
Hello everyone, I've got a problem with the following (very simple) code: void foo() { void[] dat=new void[50_000_000]; // allocate 50 MByte of dummy-data delete dat; } after I called foo() and watched the memory usage in the windows taskmanager, the program blowed up to 50 MBytes al

d2 shared delegate problem

2009-05-24 Thread AxelS
Hello everybody, directly to my problem: In class A I got a static array of delegates... class A{ private static alias void delegate() EventHandler; public static EventHandler[] MyEvent; static void Foo() { foreach(eh; MyEvent) eh(); } } ...and when I call Foo() from another Thread like... i

Re: Open GL extensions, dglut style

2009-04-14 Thread AxelS
Thank you very much! I hope that will work...

Open GL extensions?

2009-04-14 Thread AxelS
Hello evrybody... I want to use all the opengl extensions like Shaders in my D2.0 prog... I already got the opengl32.lib and also the headers... I tried it wglGetProc (similar name...)! I could compile it but it hangs up runtime and creates errors which dont tell me the actual problem... and yes