Author Topic: Foreign stack error  (Read 2033 times)

0 Members and 1 Guest are viewing this topic.

RobbeK

  • Guest
Foreign stack error
« on: July 09, 2014, 01:31:19 AM »
Hi all,

For the moment busy with kind of digging into the japi.dll  (http://www.japi.de/)  - found some things not mentioned in the documentation etc...
Got it working in CLisp , GNU CL and Clozure CL for the moment  (and FreeBasic).
However, because plotting to a canvas and even to an image , is much slower than directly writing into memory , I had to setup a flat memory zone by Oxygen ... everything works fine, except when I make executables from the Lisp image.  (the same (native code) works fine from within the Lisp shell -- ...

Any one an idea what's happening here ??  (the "foreign memory" is allocated by CCL.dll written in Oxygen - see attachm)

th i adv Rob

.
« Last Edit: July 09, 2014, 01:47:24 AM by RobbeK »

Charles Pegge

  • Guest
Re: Foreign stack error
« Reply #1 on: July 09, 2014, 04:39:07 AM »
Hi Rob,

how does ccl.dll create the memory block? Could try some alternatives.

RobbeK

  • Guest
Re: Foreign stack error
« Reply #2 on: July 09, 2014, 11:31:11 AM »
Hi Charles ,

It allocates 3 static arrays (600*600 int32 each) -- it works everywhere (but not in Clozure CL)  ... i also tried (FB) something as
(dynamic)

dim shared as integer r() , ....


public function allocred(n as integer) as any ptr export
   redim as integer r(n)
   return @r(0)
end function

no success (but I have the feeling I'm doing something unallowed here ;..    ::)

however , problem is fixed now by setting up Japi inside the DLL  -- but again, in FB and I do think it uses a static lib japi.a ? that is enclosed into the dll ...  (attached)  -- can this be done with Oxygen ???  (would be great  -- ).

Also attached, why I need this "foreign memory" -- one uses an image as an object , the other sets up an array in memory -- calculations are identical  ... the difference in speed is frappant  8)

As I can not get real addresses in Lisp ( I do not have the courage to start complex things like working with Mac Pointers (if they should work in a non *nix system )  this is my only way .. and a fast way (same for heavy calculations ..  in Common Lisp every number is a complex number .. unless a smart compiler (maybe Steel Bank CL ?) it's also a loss of speed etc ...

best Rob (thanks for ur help)







.