currently, I got it working to reference the c_rtl.fx, but unfortunately, I get this error when compiling with the “C_rtl.fx”:
Unknown namespace c_rtl
I put the c_rtl.fx into the folder where all referenced .fx are, like gc.fx, RTL.fx and so on, he compiles without any lib error, except this line, it gives me just unknown namespace
Just putting it there doesn’t do anything. You have to add it to the references list in the project. Also the things inside it need to have a namespace, for example by importing with --forcenamespace.
THANX, I also had referenced it, but the “–forcenamespace c_rtl” was missing and it works!!! Thanx!
But, I get, when I compile,: E:0 Severity Code Description Project File Line Suppression State
Error (E0) Internal error: System.InvalidCastException: Unable to cast object of type ‘RemObjects.Oxygene.Code.ParsedGenericParameter’ to type ‘RemObjects.Oxygene.Code.IMutableParsedType’.
at RemObjects.Oxygene.Code.ExplodingGenericsPass.Process()
at RemObjects.Oxygene.Code.IslandTarget.ExplodeGenerics(Compiler acompiler)
at RemObjects.Oxygene.Code.Compiler.Compiler.Compile() ElementsStuff 0
at this codeline: var ptr:^Byte := ^Byte(c_rtl.malloc(sizeOf(byte) * 10));
But this seems, that it has nothing to do with the c-call, doesnt it?
hmm, interessting, it wasnt that line, sry… because I had 4 older classes which I was working on, and I need to find out where it is, I will send it immediately, to avoid the investigation by yourself not too loose time because its a bit much
When I declare my own used TArray = record, it compiles fine but gives some allocation problems, but when I change it to TArray = class, then it gives:
Severity Code Description Project File Line Suppression State
Error (E0) Internal error: System.InvalidCastException: Unable to cast object of type ‘RemObjects.Oxygene.Code.ParsedGenericParameter’ to type ‘RemObjects.Oxygene.Code.IMutableParsedType’.
at RemObjects.Oxygene.Code.ExplodingGenericsPass.Process()
at RemObjects.Oxygene.Code.IslandTarget.ExplodeGenerics(Compiler acompiler)
at RemObjects.Oxygene.Code.Compiler.Compiler.Compile() ElementsStuff0
Ok the error was, because I since never changed it, “pointer = dynamic.-array” pseudo-code and that is bad obviously because of GC issues, as you told me back then, so I changed it internally to:
f_first := ^TBlock<T>(c_rtl._alloca(sizeOf(T) * cnt)); //allocate on the stack, but raises:
I am currently just “playing” with totall stack-allocation for implementing a short-time-pixel-buffer, that doesnt need any heap-alloc because he just shall be used as a tmp backbuffer
hmm, ok, but then they shouldnt have make it a public function then, ok nevermind^^ thx, but I want to ask you, even when I do the same line, just with malloc, I always get 0ptr back?
What I did then is this:
var size := sizeOf(TBlock<T>);
f_first := ^TBlock<T>(c_rtl.malloc(size * 3)); //allocate on heap
and the first line, the debugger isnt able to tell me the size
Hmm, I see in the malloc.h that malloca is a #define, can I make use of that?
Ok , w8 a min pls, I am now a little bit confused by this, I investigate and summarize all I said before together, that I can see: “do I get internal error and linker error” or not!
I don’t get an internal error; but that might be explained because I dont’ have the fx file you reference from the project. If you can send it I can try it again.