apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Spinetti <m.spine...@pisa.iol.it>
Subject Shared memory
Date Tue, 23 Nov 2004 11:10:57 GMT
Hi all,
I have a question about shm.
I'm trying to write a library which is coomon to all my apache (1.3.x) 
This library at the apache startup, should put my complex  structered 
data in a shared memory segment and the all apache childs read this 
Well, I'm not expert of shared memory: so I have a question.
In my startup, I create my shared memory with:

rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, pool);

My structured data is composed by an array of structures and each member 
is composed by int, pointers of char and a pointer of xsltStylesheetPtr 
So I should allocate memory with malloc. But with shared memory can I 
should allocate memory with malloc or calloc?
I'm getting segmentation fault when I try to access my structured data 
members: for example

pp->bb[insert]->id = id_int;

Can I missing something?

Thanks for the help


View raw message