Surprising that & would crash, though possible.
When you use &, the safe way is to apply memu to the value that you are
assigning to the name that is going to go into cd. So if you use
ret =. (sqrdll, 'sqr > i i *i &i') cd (#y);y;res
you should have written
res =. memu (#y)#4 NB. make sure
You can try 15!:14<'name' to get the address and then
pass this address using signature x.
But if you pass address directly, J will not downsize/upsize
the array, your callee should aware of this.
Mon, 19 Nov 2018, Ben Gorte написал(а):
> When trying & , I apparently do not know what I am doing,
When trying & , I apparently do not know what I am doing, because it
immediately crashes my session.
However, I do feel meanwhile that I get an increasing number of copies of
my (large) dataset in memory, so perhaps I should find out what I should be
doing. As I understand, & can help to avoid cop
"The memory is unaliased." refers to the memory as seen by
the callee of cd. Any changes made by callee won't be written
back to the original memory. That's why the value of names
remained unchanged after cd call. Unless you had taken
the address of name and passed the address to cd.
The release n
Dear Henry, Bill, Linda,
Thanks for your responses, I am getting the point/ers.
Perhaps in
https://code.jsoftware.com/wiki/Guides/DLLs/Calling_DLLs#J807_Incompatibilities
, the phrase: "The DLL can read or write this memory." is a bit confusing,
although it also says "The memory is unaliased." Th
What Bill is saying is that starting in 807, cd makes an copy of any
argument to cd that might be shared by another noun. So, the value of
'res' is put into a temporary block and passed to the DLL. The
temporary block is put into the boxed result of cd. You need to look in
that boxed result,
j807 must get from result of cd, like this
0 3{ (sqrdll, 'sqr i i *i *i') cd (#y);y;res
On Sun, Nov 18, 2018, 2:22 PM Ben Gorte Dear All,
>
> Long ago I made quite a lot of c-functions that I am calling from J using
> the cd mechanism (load 'dll') in linux.
>
> They stopped working in j64-807. I
Would this work?
(+/a),a=:*:i.10
285 0 1 4 9 16 25 36 49 64 81
Lihda
Sent from my Verizon, Samsung Galaxy smartphone
Original message
From: Ben Gorte
Date: 11/18/18 1:22 AM (GMT-05:00)
To: programm...@jsoftware.com
Subject: [Jprogramming] j807 cd - pass array arguments
Dear
Dear All,
Long ago I made quite a lot of c-functions that I am calling from J using
the cd mechanism (load 'dll') in linux.
They stopped working in j64-807. I see in the release notes that indeed
something has changed, but I cannot quite relate that to my case (but maybe
I should - I'm not sure I