Re: Problem with copying text to the Windows clipboard
- Posted by mattlewis (admin) Mar 21, 2009
- 999 views
The global allocate function was originally used by MS for 16-bit
applications running in win32 and allocates memory from the
internal Heap. Euphoria 3.11 also uses the same Heap for its
memory management. Ver 4.0 has changed the way it handles
memory management on Win XP. Therefore you might consider
trying to use Ver 4.0 for your application and see if you
experience the same problem.
Actually, they both ultimately use the same allocation function on windows. The difference is that 3.1 also caches the memory internally, in an attempt to speed up allocation and freeing memory. In effect, this duplicates the work of the OS. In the early days, this method was much faster, but as operating systems have matured, the difference has disappeared or shrunk.
There are other issues, where older versions of windows do not guarantee 8-byte aligned allocations (Win2K+ does, IIRC, as well as modern linuxes and bsds). This is critical for euphoria objects, and the internal memory handling has some workarounds to be able to properly allocate and free memory when the OS does not guarantee this.
Also, the clip board requires memory to be allocated in a special way, using GlobalAlloc, which I believe Greg's library uses. I haven't looked at the code in question, though, so I can't say where the problem might be (and I'm not on windows now, so I can't test it).
Matt