Mail Archives: djgpp/1998/08/10/02:41:27
On 9 Aug 1998, Bruno Barberi Gnecco wrote:
> Debugging it, I find that the error is exactly at the line that
> allocates memory to a new line (it allocates 1 byte). I'm running
> the Windows 95 DPMI server. What may be the problem?
You need to supply more information to get meaningful replies. At the
very least, explain what is that ``error exactly at the line that
allocates memory to a new line''. Please describe what is the problem
that you see under a debugger.
> Is there a better way to allocate memory?
Yes. The usual method is to allocate memory for the buffer, and then
maintain pointers into that buffer which point to the beginning of
each line. There are other methods as well. For example, an editor
could be totally oblivious to the line-oriented structure of text, and
instead treat it as a stream of bytes.
> Can I use the DPMI functions to allocate memory directly?
Yes, you can, but don't do that. It will usually get you into more
trouble.
- Raw text -