nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER


From: David Benbennick
Subject: Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER
Date: Sun, 7 Apr 2002 06:11:48 -0400 (EDT)

I have this quixotic goal of removing many global variables from global.c:
        filename, current, current_x, current_y, fileage, flags, filebot,
        totsize, totlines, placewewant, mark_beginbuf, mark_beginx
and replacing them with their openfilestruct counterparts.

The attached patch is a step in this direction: there is no totsize
variable anymore.  It is replaced by open_files->file_totsize everywhere.  
To make that work, I hacked up files.c to have it allocate a new
openfilestruct entry *before* loading the file instead of after.

I am sending the patch now because it works.  It definitely should not be
applied in this form.  I probably added some bugs, and the code size
increased by ~400 bytes.

My next step is to replace the rest of the globals listed.  Then I can
take out the functions that deal with synchronizing open_files with the
globals.  Finally, I intend to rework the files.c public interface.

What I am doing is experimental.  I think the code will be smaller when I
am done, and maybe the file opening code will be better and more unified.  
But, maybe all the extra -> dereferences will outweigh and make the binary
lots bigger.

I'll send another patch when I make another big step.  By the way, this
patch includes DLR's nanopieces2.


David

Attachment: dbpieces3.patch.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]