Is it good to save svOpenArrayHandle for later usage?

In reply to dave_59:

I need to explain step 3 a bit more. In this step, this “another” C function is called by vpi value change callback (to mimic @(posedge clk)) and it will send some data to SV side.

The idea above is just to do memory copy in this C function to the memory pointed to by the svOpenArrayHandle. It is because DPI export doesn’t support open array.

Like what you said, even we allocate dynamic array once and keep using it, it’s still likely to be moved around then this will fail sooner or later.

If we change the dynamic array to fixed size array, let’s say the fixed size array is a member of object, looks its memory still can be moved.