[vorbis-dev] new DLL additions in core libs

Chris Wolf cwolf at starclass.com
Wed Sep 12 13:50:43 PDT 2001



*********** REPLY SEPARATOR  ***********

On 9/12/2001 at 11:53 AM Kenneth Arnold wrote:

>On Wed, Sep 12, 2001 at 12:42:39PM -0700, Segher Boessenkool wrote:
>You're sure that you can't have a function that returns a pointer to
>the shared area? I guess that would accomplish the same thing as
>adding the array to the symbol table, which apparently doesn't work. I
>missed the earlier discussion about this but I gather that it has
>something to do with the codebooks and modes; couldn't both of these
>simply go in libvorbisenc? Failing that, whatever structures are
>shared that are the issue could have an associated function to copy
>the data into a shared memory area -- but I don't really get why Win32
>imposes this limitation in the first place. Libraries should be able
>to access a static variable from an application if it is passed as a
>pointer; why not another library? Or am I mistaken and pointers would
>work? Or am I just too clueless about win32 to be talking at all?
>
>-- 
>Kenneth Arnold <ken at arnoldnet.net> / kcarnold / Linux user #180115
>http://arnoldnet.net/~kcarnold/
>

The problem is DLL's accessing each other's data segments -- it can't be done except
via shared memory.  The probem in this case, is vorbisenc.dll accessing statically 
initialized data in vorbis.dll.  

I did notice one very interesting thing, however.  There is a function which uses dynamic
memory allocation (_vi_psy_copy in psy.c) which creates the same sort of array of function
pointer stuctures. The intra-DLL sharing of that data works without resorting to the shared memory contraption.
Personally, I think it's safer to use static allocation and initializtion when possible, however,
if the stuff in registry.c were to be dynamically setup like psy.c, then that shared memory
mechanism might not be necessary.  Then again, I not certain such code restructuring 
is justified just to accomodate win32.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list