Mail Archives: djgpp/1998/04/09/11:16:53
> Also, do you suppose it's portable to return pointers from executables?
> It seems to me that any system would be able to return a pointer pretty
> easily, considering pointers are almost always size_of(int) and int
> seems to be returned all the time. I'm just wondering if there are any
> odd problems I should know about.
Yes, lots of odd problems.
Number 1: The memory has been freed, so if you try to use the pointer,
you'll get a SEGV.
Number 2: The memory does not belong to the first program anyway even if
it wasnt freed. See #1 for results.
Number 3: Selector may be different. Even excluding #1 & 2, this would
cause you to lose the exact memory.
What exactly are you trying to use it for? It almost sounds like a case
where a dynamic linker (like DLX (c) me) would be more useful than just
executable files with strange pointer layout.
- Raw text -