Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Nothing is simple

Last I successfully loaded everything into memory. This morning a modified by main program to read the memory by cutting and pasting from my test read program. Naturally, it didn't work. So I printed out the address that both programs were using and out different ones. ??
 
Last I successfully loaded everything into memory. This morning a modified by main program to read the memory by cutting and pasting from my test read program. Naturally, it didn't work. So I printed out the address that both programs were using and out different ones. ??

If you are using using the pointer returned from shmat(), then the different addresses should not matter. You could try passing a fixed address to shmat if you really wanted. As I recall (without looking at the posts from yesterday), you took out all the pointers within the structure. Most likely you introduced a bug somewhere during the copy-and-paste.
 
Are you looking at the address returned from shmat? This will vary from call to call. There's not a global address space from which you get a pointer to the same "place". Each process has its own memory space, and shmat will "map" the shared memory managed by the system into your processes address space.

So that, in and of itself, is not a problem. Can you try with one file, and see if you can save the structure, then try to read it back out with a separate program? Are you sure your NWAVES is the same on both so the size of the structure is the same?

-Lee
 
thanks

Never assume.
I put in a print statement right after getting the address and at that point everything seemed okay.
Thanks guys. You are really a big help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.