Path: utzoo!dciem!nrcaer!sce!graham From: graham@sce.UUCP (Doug Graham) Newsgroups: comp.emacs Subject: Re: Buffer data structures Message-ID: <394@sce.UUCP> Date: 29 Jun 88 10:02:33 GMT Article-I.D.: sce.394 References: <18612@cornell.UUCP> Organization: Systems Eng., Carleton University, Ottawa, Ontario, Canada Lines: 27 > published in some computer magazine WAY BACK. Byte, maybe.) The > problem comes when the gap gets filled in; if you've got the whole address > space to yourself, you just tell the user "tough luck," but if you're > in a multitasking environment, you need to ask for more space; I'd > make a linked list of blocks, each with its own gap. If a block > is empty, you free its space. Another problem with the single chunk of memory with a gap in the middle, is that a lot of time can be spent copying text to one end or the other of the memory space whenever the gap must be moved. This becomes very apparent when editing a large file on slow machine like this little PC here. Seems that your approach would solve this problem because the maximum amount of text that would have to be copied could be limited to the block size. But I think you could wind up wasting a lot of memory with half filled blocks. On a related note, I would like to Jonathan Payne about the structure he used for Jove. It uses a linked list of line structures kept in memory. The actual text of the line is kept in "virtual memory" with a virtual address in the line structure pointing to it. I would like to know why he chose to keep the line structures in memory rather than putting them in "virtual memory" as well. This decision means that Jove cannot be used to edit files containing a large number of lines on machines with a limited amount of memory. Are there advantages to doing things this way? Doug.