Hi!
I'm trying to use the shared memory with GPC.
The service I've written in C to map into the shared memory region accepts void **pointer_to_set_arg.
I declare:
type xyz_str_type = record id : integer; name : string(80); end; xyz_ptr_type = ^xyz_str_type;
var xyz_ptr : xyz_ptr_type; xyz_str : xyz_str_type; tmp_ptr : pointer;
...
in code I do: exp_shm_map (..., Add(tmp_ptr),...);
xyz_ptr := xyz_ptr_type (tmp_ptr);
xyz_ptr^.str := xyz.str;
writeln (xyz_ptr^.str);
In other program I just print the xyz_ptr^.str after I map into an existing shared memory region.
The problem is that it doesn't work.
I get nothing printed.
But when I write xyz_ptr^ := xyz;
everything works.
It seems that something is done when new String variable is allocated. Some kind of initialization!
Is there any way to overcome the diffculty without using the xyz strcuture allocated explicitly?
Thank you,
Nick
Nick Ioffe wrote:
It seems that something is done when new String variable is allocated. Some kind of initialization!
Exactly (capacity).
Is there any way to overcome the diffculty without using the xyz strcuture allocated explicitly?
Initialize (xyz_ptr^)
Frank