|
Karsten Hopp |
be9a99 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
be9a99 |
Subject: Patch 7.3.143
|
|
Karsten Hopp |
be9a99 |
Fcc: outbox
|
|
Karsten Hopp |
be9a99 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
be9a99 |
Mime-Version: 1.0
|
|
Karsten Hopp |
be9a99 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
be9a99 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
be9a99 |
------------
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
Patch 7.3.143
|
|
Karsten Hopp |
be9a99 |
Problem: Memfile is not tested sufficiently. Looking up blocks in a
|
|
Karsten Hopp |
be9a99 |
memfile is slow when there are many blocks.
|
|
Karsten Hopp |
be9a99 |
Solution: Add high level test and unittest. Adjust the number of hash
|
|
Karsten Hopp |
be9a99 |
buckets to the number of blocks. (Ivan Krasilnikov)
|
|
Karsten Hopp |
be9a99 |
Files: Filelist, src/Makefile, src/main.c, src/memfile.c,
|
|
Karsten Hopp |
be9a99 |
src/memfile_test.c src/structs.h src/testdir/Make_amiga.mak,
|
|
Karsten Hopp |
be9a99 |
src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
|
|
Karsten Hopp |
be9a99 |
src/testdir/Make_os2.mak, src/testdir/Make_vms.mak,
|
|
Karsten Hopp |
be9a99 |
src/testdir/Makefile, src/testdir/test77.in, src/testdir/test77.ok
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/Filelist 2010-08-15 21:57:20.000000000 +0200
|
|
Karsten Hopp |
be9a99 |
--- Filelist 2011-03-22 17:39:22.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 39,44 ****
|
|
Karsten Hopp |
be9a99 |
--- 39,45 ----
|
|
Karsten Hopp |
be9a99 |
src/mark.c \
|
|
Karsten Hopp |
be9a99 |
src/mbyte.c \
|
|
Karsten Hopp |
be9a99 |
src/memfile.c \
|
|
Karsten Hopp |
be9a99 |
+ src/memfile_test.c \
|
|
Karsten Hopp |
be9a99 |
src/memline.c \
|
|
Karsten Hopp |
be9a99 |
src/menu.c \
|
|
Karsten Hopp |
be9a99 |
src/message.c \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 686,691 ****
|
|
Karsten Hopp |
be9a99 |
--- 687,694 ----
|
|
Karsten Hopp |
be9a99 |
runtime/tutor/tutor.utf-8 \
|
|
Karsten Hopp |
be9a99 |
runtime/tutor/tutor.?? \
|
|
Karsten Hopp |
be9a99 |
runtime/tutor/tutor.??.* \
|
|
Karsten Hopp |
be9a99 |
+ runtime/tutor/tutor.bar \
|
|
Karsten Hopp |
be9a99 |
+ runtime/tutor/tutor.bar.* \
|
|
Karsten Hopp |
be9a99 |
runtime/spell/README.txt \
|
|
Karsten Hopp |
be9a99 |
runtime/spell/??/*.diff \
|
|
Karsten Hopp |
be9a99 |
runtime/spell/??/main.aap \
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/Makefile 2011-02-15 15:27:00.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/Makefile 2011-03-22 18:07:25.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 561,567 ****
|
|
Karsten Hopp |
be9a99 |
#CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Use this with GCC to check for mistakes, unused arguments, etc.
|
|
Karsten Hopp |
be9a99 |
! #CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -D_FORTIFY_SOURCE=1 -DU_DEBUG
|
|
Karsten Hopp |
be9a99 |
#CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -D_FORTIFY_SOURCE=1 -DU_DEBUG
|
|
Karsten Hopp |
be9a99 |
#PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
|
|
Karsten Hopp |
be9a99 |
#MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
|
|
Karsten Hopp |
be9a99 |
--- 561,567 ----
|
|
Karsten Hopp |
be9a99 |
#CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Use this with GCC to check for mistakes, unused arguments, etc.
|
|
Karsten Hopp |
be9a99 |
! #CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -D_FORTIFY_SOURCE=1
|
|
Karsten Hopp |
be9a99 |
#CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -D_FORTIFY_SOURCE=1 -DU_DEBUG
|
|
Karsten Hopp |
be9a99 |
#PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
|
|
Karsten Hopp |
be9a99 |
#MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 594,601 ****
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
|
|
Karsten Hopp |
be9a99 |
# Might not work with GUI or Perl.
|
|
Karsten Hopp |
be9a99 |
! # For unknown reasons adding "-lc" fixes a linking problem with GCC. That's
|
|
Karsten Hopp |
be9a99 |
! # probably a bug in the "-pg" implementation.
|
|
Karsten Hopp |
be9a99 |
# Need to recompile everything after changing this: "make clean" "make".
|
|
Karsten Hopp |
be9a99 |
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
|
|
Karsten Hopp |
be9a99 |
#PROFILE_LIBS = -pg
|
|
Karsten Hopp |
be9a99 |
--- 594,602 ----
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
|
|
Karsten Hopp |
be9a99 |
# Might not work with GUI or Perl.
|
|
Karsten Hopp |
be9a99 |
! # For unknown reasons adding "-lc" fixes a linking problem with some versions
|
|
Karsten Hopp |
be9a99 |
! # of GCC. That's probably a bug in the "-pg" implementation.
|
|
Karsten Hopp |
be9a99 |
! # After running Vim see the profile result with: gmon vim gmon.out | vim -
|
|
Karsten Hopp |
be9a99 |
# Need to recompile everything after changing this: "make clean" "make".
|
|
Karsten Hopp |
be9a99 |
#PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
|
|
Karsten Hopp |
be9a99 |
#PROFILE_LIBS = -pg
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 606,613 ****
|
|
Karsten Hopp |
be9a99 |
# Configuration is in the .ccmalloc or ~/.ccmalloc file.
|
|
Karsten Hopp |
be9a99 |
# Doesn't work very well, since memory linked to from global variables
|
|
Karsten Hopp |
be9a99 |
# (in libraries) is also marked as leaked memory.
|
|
Karsten Hopp |
be9a99 |
! #PROFILE_CFLAGS = -DEXITFREE
|
|
Karsten Hopp |
be9a99 |
! #PROFILE_LIBS = -lccmalloc
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
#####################################################
|
|
Karsten Hopp |
be9a99 |
### Specific systems, check if yours is listed! ### {{{
|
|
Karsten Hopp |
be9a99 |
--- 607,614 ----
|
|
Karsten Hopp |
be9a99 |
# Configuration is in the .ccmalloc or ~/.ccmalloc file.
|
|
Karsten Hopp |
be9a99 |
# Doesn't work very well, since memory linked to from global variables
|
|
Karsten Hopp |
be9a99 |
# (in libraries) is also marked as leaked memory.
|
|
Karsten Hopp |
be9a99 |
! #LEAK_CFLAGS = -DEXITFREE
|
|
Karsten Hopp |
be9a99 |
! #LEAK_LIBS = -lccmalloc
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
#####################################################
|
|
Karsten Hopp |
be9a99 |
### Specific systems, check if yours is listed! ### {{{
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1329,1335 ****
|
|
Karsten Hopp |
be9a99 |
PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
|
|
Karsten Hopp |
be9a99 |
POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
|
|
Karsten Hopp |
be9a99 |
# with "-E".
|
|
Karsten Hopp |
be9a99 |
--- 1330,1336 ----
|
|
Karsten Hopp |
be9a99 |
PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
|
|
Karsten Hopp |
be9a99 |
POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
|
|
Karsten Hopp |
be9a99 |
# with "-E".
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1358,1364 ****
|
|
Karsten Hopp |
be9a99 |
$(PYTHON3_LIBS) \
|
|
Karsten Hopp |
be9a99 |
$(TCL_LIBS) \
|
|
Karsten Hopp |
be9a99 |
$(RUBY_LIBS) \
|
|
Karsten Hopp |
be9a99 |
! $(PROFILE_LIBS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# abbreviations
|
|
Karsten Hopp |
be9a99 |
DEST_BIN = $(DESTDIR)$(BINDIR)
|
|
Karsten Hopp |
be9a99 |
--- 1359,1366 ----
|
|
Karsten Hopp |
be9a99 |
$(PYTHON3_LIBS) \
|
|
Karsten Hopp |
be9a99 |
$(TCL_LIBS) \
|
|
Karsten Hopp |
be9a99 |
$(RUBY_LIBS) \
|
|
Karsten Hopp |
be9a99 |
! $(PROFILE_LIBS) \
|
|
Karsten Hopp |
be9a99 |
! $(LEAK_LIBS)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# abbreviations
|
|
Karsten Hopp |
be9a99 |
DEST_BIN = $(DESTDIR)$(BINDIR)
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1480,1487 ****
|
|
Karsten Hopp |
be9a99 |
if_python.c if_python3.c if_tcl.c if_ruby.c if_sniff.c \
|
|
Karsten Hopp |
be9a99 |
gui_beval.c workshop.c wsdebug.c integration.c netbeans.c
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# All sources, also the ones that are not configured
|
|
Karsten Hopp |
be9a99 |
! ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(EXTRA_SRC)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Which files to check with lint. Select one of these three lines. ALL_SRC
|
|
Karsten Hopp |
be9a99 |
# checks more, but may not work well for checking a GUI that wasn't configured.
|
|
Karsten Hopp |
be9a99 |
--- 1482,1496 ----
|
|
Karsten Hopp |
be9a99 |
if_python.c if_python3.c if_tcl.c if_ruby.c if_sniff.c \
|
|
Karsten Hopp |
be9a99 |
gui_beval.c workshop.c wsdebug.c integration.c netbeans.c
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ # Unittest files
|
|
Karsten Hopp |
be9a99 |
+ MEMFILE_TEST_SRC = memfile_test.c
|
|
Karsten Hopp |
be9a99 |
+ MEMFILE_TEST_TARGET = memfile_test$(EXEEXT)
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ UNITTEST_SRC = $(MEMFILE_TEST_SRC)
|
|
Karsten Hopp |
be9a99 |
+ UNITTEST_TARGETS = $(MEMFILE_TEST_TARGET)
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
# All sources, also the ones that are not configured
|
|
Karsten Hopp |
be9a99 |
! ALL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
# Which files to check with lint. Select one of these three lines. ALL_SRC
|
|
Karsten Hopp |
be9a99 |
# checks more, but may not work well for checking a GUI that wasn't configured.
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1492,1498 ****
|
|
Karsten Hopp |
be9a99 |
#LINT_SRC = $(ALL_SRC)
|
|
Karsten Hopp |
be9a99 |
#LINT_SRC = $(BASIC_SRC)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! OBJ = \
|
|
Karsten Hopp |
be9a99 |
objects/buffer.o \
|
|
Karsten Hopp |
be9a99 |
objects/blowfish.o \
|
|
Karsten Hopp |
be9a99 |
objects/charset.o \
|
|
Karsten Hopp |
be9a99 |
--- 1501,1507 ----
|
|
Karsten Hopp |
be9a99 |
#LINT_SRC = $(ALL_SRC)
|
|
Karsten Hopp |
be9a99 |
#LINT_SRC = $(BASIC_SRC)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! OBJ_COMMON = \
|
|
Karsten Hopp |
be9a99 |
objects/buffer.o \
|
|
Karsten Hopp |
be9a99 |
objects/blowfish.o \
|
|
Karsten Hopp |
be9a99 |
objects/charset.o \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1513,1522 ****
|
|
Karsten Hopp |
be9a99 |
$(HANGULIN_OBJ) \
|
|
Karsten Hopp |
be9a99 |
objects/if_cscope.o \
|
|
Karsten Hopp |
be9a99 |
objects/if_xcmdsrv.o \
|
|
Karsten Hopp |
be9a99 |
- objects/main.o \
|
|
Karsten Hopp |
be9a99 |
objects/mark.o \
|
|
Karsten Hopp |
be9a99 |
! objects/memfile.o \
|
|
Karsten Hopp |
be9a99 |
! objects/memline.o \
|
|
Karsten Hopp |
be9a99 |
objects/menu.o \
|
|
Karsten Hopp |
be9a99 |
objects/message.o \
|
|
Karsten Hopp |
be9a99 |
objects/misc1.o \
|
|
Karsten Hopp |
be9a99 |
--- 1522,1529 ----
|
|
Karsten Hopp |
be9a99 |
$(HANGULIN_OBJ) \
|
|
Karsten Hopp |
be9a99 |
objects/if_cscope.o \
|
|
Karsten Hopp |
be9a99 |
objects/if_xcmdsrv.o \
|
|
Karsten Hopp |
be9a99 |
objects/mark.o \
|
|
Karsten Hopp |
be9a99 |
! objects/memline.o \
|
|
Karsten Hopp |
be9a99 |
objects/menu.o \
|
|
Karsten Hopp |
be9a99 |
objects/message.o \
|
|
Karsten Hopp |
be9a99 |
objects/misc1.o \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1541,1546 ****
|
|
Karsten Hopp |
be9a99 |
--- 1548,1554 ----
|
|
Karsten Hopp |
be9a99 |
objects/term.o \
|
|
Karsten Hopp |
be9a99 |
objects/ui.o \
|
|
Karsten Hopp |
be9a99 |
objects/undo.o \
|
|
Karsten Hopp |
be9a99 |
+ objects/version.o \
|
|
Karsten Hopp |
be9a99 |
objects/window.o \
|
|
Karsten Hopp |
be9a99 |
$(GUI_OBJ) \
|
|
Karsten Hopp |
be9a99 |
$(LUA_OBJ) \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1555,1560 ****
|
|
Karsten Hopp |
be9a99 |
--- 1563,1575 ----
|
|
Karsten Hopp |
be9a99 |
$(NETBEANS_OBJ) \
|
|
Karsten Hopp |
be9a99 |
$(WSDEBUG_OBJ)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ OBJ = $(OBJ_COMMON) \
|
|
Karsten Hopp |
be9a99 |
+ objects/main.o \
|
|
Karsten Hopp |
be9a99 |
+ objects/memfile.o \
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ MEMFILE_TEST_OBJ = $(OBJ_COMMON) \
|
|
Karsten Hopp |
be9a99 |
+ objects/memfile_test.o
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
PRO_AUTO = \
|
|
Karsten Hopp |
be9a99 |
blowfish.pro \
|
|
Karsten Hopp |
be9a99 |
buffer.pro \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1700,1706 ****
|
|
Karsten Hopp |
be9a99 |
$(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h
|
|
Karsten Hopp |
be9a99 |
$(CCC) version.c -o objects/version.o
|
|
Karsten Hopp |
be9a99 |
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
|
Karsten Hopp |
be9a99 |
! -o $(VIMTARGET) $(OBJ) objects/version.o $(ALL_LIBS)" \
|
|
Karsten Hopp |
be9a99 |
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
|
Karsten Hopp |
be9a99 |
sh $(srcdir)/link.sh
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 1715,1721 ----
|
|
Karsten Hopp |
be9a99 |
$(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h
|
|
Karsten Hopp |
be9a99 |
$(CCC) version.c -o objects/version.o
|
|
Karsten Hopp |
be9a99 |
@LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
|
Karsten Hopp |
be9a99 |
! -o $(VIMTARGET) $(OBJ) $(ALL_LIBS)" \
|
|
Karsten Hopp |
be9a99 |
MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
|
Karsten Hopp |
be9a99 |
sh $(srcdir)/link.sh
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1825,1830 ****
|
|
Karsten Hopp |
be9a99 |
--- 1840,1854 ----
|
|
Karsten Hopp |
be9a99 |
ln -s $(VIMTARGET) vim; \
|
|
Karsten Hopp |
be9a99 |
fi
|
|
Karsten Hopp |
be9a99 |
cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG)
|
|
Karsten Hopp |
be9a99 |
+ $(MAKE) -f Makefile unittest
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ unittesttargets:
|
|
Karsten Hopp |
be9a99 |
+ $(MAKE) -f Makefile $(UNITTEST_TARGETS)
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ unittest unittests: $(UNITTEST_TARGETS)
|
|
Karsten Hopp |
be9a99 |
+ @for t in $(UNITTEST_TARGETS); do \
|
|
Karsten Hopp |
be9a99 |
+ ./$$t || exit 1; echo $$t passed; \
|
|
Karsten Hopp |
be9a99 |
+ done
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
testclean:
|
|
Karsten Hopp |
be9a99 |
cd testdir; $(MAKE) -f Makefile clean
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1832,1837 ****
|
|
Karsten Hopp |
be9a99 |
--- 1856,1872 ----
|
|
Karsten Hopp |
be9a99 |
cd $(PODIR); $(MAKE) checkclean; \
|
|
Karsten Hopp |
be9a99 |
fi
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ # Unittests
|
|
Karsten Hopp |
be9a99 |
+ # It's build just like Vim to satisfy all dependencies.
|
|
Karsten Hopp |
be9a99 |
+ $(MEMFILE_TEST_TARGET): auto/config.mk objects $(MEMFILE_TEST_OBJ)
|
|
Karsten Hopp |
be9a99 |
+ $(CCC) version.c -o objects/version.o
|
|
Karsten Hopp |
be9a99 |
+ @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \
|
|
Karsten Hopp |
be9a99 |
+ -o $(MEMFILE_TEST_TARGET) $(MEMFILE_TEST_OBJ) $(ALL_LIBS)" \
|
|
Karsten Hopp |
be9a99 |
+ MAKE="$(MAKE)" LINK_AS_NEEDED=$(LINK_AS_NEEDED) \
|
|
Karsten Hopp |
be9a99 |
+ sh $(srcdir)/link.sh
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ # install targets
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
install: $(GUI_INSTALL)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
install_normal: installvim installtools $(INSTALL_LANGS) install-icons
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 2265,2270 ****
|
|
Karsten Hopp |
be9a99 |
--- 2300,2306 ----
|
|
Karsten Hopp |
be9a99 |
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
|
Karsten Hopp |
be9a99 |
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c
|
|
Karsten Hopp |
be9a99 |
-rm -f conftest* *~ auto/link.sed
|
|
Karsten Hopp |
be9a99 |
+ -rm -f $(UNITTEST_TARGETS)
|
|
Karsten Hopp |
be9a99 |
-rm -f runtime pixmaps
|
|
Karsten Hopp |
be9a99 |
-rm -rf $(APPDIR)
|
|
Karsten Hopp |
be9a99 |
-rm -rf mzscheme_base.c
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 2559,2564 ****
|
|
Karsten Hopp |
be9a99 |
--- 2595,2603 ----
|
|
Karsten Hopp |
be9a99 |
objects/memfile.o: memfile.c
|
|
Karsten Hopp |
be9a99 |
$(CCC) -o $@ memfile.c
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ objects/memfile_test.o: memfile_test.c
|
|
Karsten Hopp |
be9a99 |
+ $(CCC) -o $@ memfile_test.c
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
objects/memline.o: memline.c
|
|
Karsten Hopp |
be9a99 |
$(CCC) -o $@ memline.c
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 2877,2883 ****
|
|
Karsten Hopp |
be9a99 |
objects/os_unix.o: os_unix.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
! arabic.h if_mzsch.h os_unixx.h
|
|
Karsten Hopp |
be9a99 |
objects/pathdef.o: auto/pathdef.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
--- 2916,2922 ----
|
|
Karsten Hopp |
be9a99 |
objects/os_unix.o: os_unix.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
! arabic.h os_unixx.h
|
|
Karsten Hopp |
be9a99 |
objects/pathdef.o: auto/pathdef.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3016,3021 ****
|
|
Karsten Hopp |
be9a99 |
--- 3055,3064 ----
|
|
Karsten Hopp |
be9a99 |
objects/pty.o: pty.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \
|
|
Karsten Hopp |
be9a99 |
keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \
|
|
Karsten Hopp |
be9a99 |
proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h arabic.h
|
|
Karsten Hopp |
be9a99 |
+ objects/memfile_test.o: memfile_test.c main.c vim.h auto/config.h feature.h \
|
|
Karsten Hopp |
be9a99 |
+ os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h \
|
|
Karsten Hopp |
be9a99 |
+ structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h \
|
|
Karsten Hopp |
be9a99 |
+ proto.h globals.h farsi.h arabic.h farsi.c arabic.c memfile.c
|
|
Karsten Hopp |
be9a99 |
objects/hangulin.o: hangulin.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3027,3033 ****
|
|
Karsten Hopp |
be9a99 |
objects/if_mzsch.o: if_mzsch.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
! globals.h farsi.h arabic.h if_mzsch.h mzscheme_base.c
|
|
Karsten Hopp |
be9a99 |
objects/if_perl.o: auto/if_perl.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
--- 3070,3076 ----
|
|
Karsten Hopp |
be9a99 |
objects/if_mzsch.o: if_mzsch.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
! globals.h farsi.h arabic.h if_mzsch.h
|
|
Karsten Hopp |
be9a99 |
objects/if_perl.o: auto/if_perl.c vim.h auto/config.h feature.h os_unix.h \
|
|
Karsten Hopp |
be9a99 |
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
|
|
Karsten Hopp |
be9a99 |
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3048,3054 ****
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
arabic.h
|
|
Karsten Hopp |
be9a99 |
! objects/if_ruby.o: if_ruby.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
arabic.h version.h
|
|
Karsten Hopp |
be9a99 |
--- 3091,3097 ----
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
arabic.h
|
|
Karsten Hopp |
be9a99 |
! objects/if_ruby.o: if_ruby.c auto/config.h vim.h feature.h os_unix.h auto/osdef.h \
|
|
Karsten Hopp |
be9a99 |
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
|
|
Karsten Hopp |
be9a99 |
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
|
|
Karsten Hopp |
be9a99 |
arabic.h version.h
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/main.c 2011-02-15 16:29:54.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/main.c 2011-03-18 13:19:48.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 92,128 ****
|
|
Karsten Hopp |
be9a99 |
#define EDIT_TAG 3 /* tag name argument given, use tagname */
|
|
Karsten Hopp |
be9a99 |
#define EDIT_QF 4 /* start in quickfix mode */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if defined(UNIX) || defined(VMS)
|
|
Karsten Hopp |
be9a99 |
static int file_owned __ARGS((char *fname));
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
static void mainerr __ARGS((int, char_u *));
|
|
Karsten Hopp |
be9a99 |
static void main_msg __ARGS((char *s));
|
|
Karsten Hopp |
be9a99 |
static void usage __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
static int get_number_arg __ARGS((char_u *p, int *idx, int def));
|
|
Karsten Hopp |
be9a99 |
! #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
|
Karsten Hopp |
be9a99 |
static void init_locale __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! #endif
|
|
Karsten Hopp |
be9a99 |
static void parse_command_name __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void early_arg_scan __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void command_line_scan __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void check_tty __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void read_stdin __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
static void create_windows __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
! #ifdef FEAT_WINDOWS
|
|
Karsten Hopp |
be9a99 |
static void edit_buffers __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
! #endif
|
|
Karsten Hopp |
be9a99 |
static void exe_pre_commands __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void exe_commands __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void source_startup_scripts __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void main_start_gui __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! #if defined(HAS_SWAP_EXISTS_ACTION)
|
|
Karsten Hopp |
be9a99 |
static void check_swap_exists_action __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! #endif
|
|
Karsten Hopp |
be9a99 |
! #ifdef FEAT_CLIENTSERVER
|
|
Karsten Hopp |
be9a99 |
static void exec_on_server __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void prepare_server __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void cmdsrv_main __ARGS((int *argc, char **argv, char_u *serverName_arg, char_u **serverStr));
|
|
Karsten Hopp |
be9a99 |
static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 92,130 ----
|
|
Karsten Hopp |
be9a99 |
#define EDIT_TAG 3 /* tag name argument given, use tagname */
|
|
Karsten Hopp |
be9a99 |
#define EDIT_QF 4 /* start in quickfix mode */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
|
|
Karsten Hopp |
be9a99 |
static int file_owned __ARGS((char *fname));
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
static void mainerr __ARGS((int, char_u *));
|
|
Karsten Hopp |
be9a99 |
+ #ifndef NO_VIM_MAIN
|
|
Karsten Hopp |
be9a99 |
static void main_msg __ARGS((char *s));
|
|
Karsten Hopp |
be9a99 |
static void usage __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
static int get_number_arg __ARGS((char_u *p, int *idx, int def));
|
|
Karsten Hopp |
be9a99 |
! # if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
|
Karsten Hopp |
be9a99 |
static void init_locale __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! # endif
|
|
Karsten Hopp |
be9a99 |
static void parse_command_name __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void early_arg_scan __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void command_line_scan __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void check_tty __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void read_stdin __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
static void create_windows __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
! # ifdef FEAT_WINDOWS
|
|
Karsten Hopp |
be9a99 |
static void edit_buffers __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
! # endif
|
|
Karsten Hopp |
be9a99 |
static void exe_pre_commands __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void exe_commands __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void source_startup_scripts __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void main_start_gui __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! # if defined(HAS_SWAP_EXISTS_ACTION)
|
|
Karsten Hopp |
be9a99 |
static void check_swap_exists_action __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
! # endif
|
|
Karsten Hopp |
be9a99 |
! # if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
|
Karsten Hopp |
be9a99 |
static void exec_on_server __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void prepare_server __ARGS((mparm_T *parmp));
|
|
Karsten Hopp |
be9a99 |
static void cmdsrv_main __ARGS((int *argc, char **argv, char_u *serverName_arg, char_u **serverStr));
|
|
Karsten Hopp |
be9a99 |
static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
|
|
Karsten Hopp |
be9a99 |
+ # endif
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 145,151 ****
|
|
Karsten Hopp |
be9a99 |
#define ME_INVALID_ARG 5
|
|
Karsten Hopp |
be9a99 |
};
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #ifndef PROTO /* don't want a prototype for main() */
|
|
Karsten Hopp |
be9a99 |
int
|
|
Karsten Hopp |
be9a99 |
# ifdef VIMDLL
|
|
Karsten Hopp |
be9a99 |
_export
|
|
Karsten Hopp |
be9a99 |
--- 147,154 ----
|
|
Karsten Hopp |
be9a99 |
#define ME_INVALID_ARG 5
|
|
Karsten Hopp |
be9a99 |
};
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #ifndef NO_VIM_MAIN /* skip this for unittests */
|
|
Karsten Hopp |
be9a99 |
! #ifndef PROTO /* don't want a prototype for main() */
|
|
Karsten Hopp |
be9a99 |
int
|
|
Karsten Hopp |
be9a99 |
# ifdef VIMDLL
|
|
Karsten Hopp |
be9a99 |
_export
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 966,971 ****
|
|
Karsten Hopp |
be9a99 |
--- 969,975 ----
|
|
Karsten Hopp |
be9a99 |
return 0;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
#endif /* PROTO */
|
|
Karsten Hopp |
be9a99 |
+ #endif /* NO_VIM_MAIN */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Main loop: Execute Normal mode commands until exiting Vim.
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1430,1435 ****
|
|
Karsten Hopp |
be9a99 |
--- 1434,1440 ----
|
|
Karsten Hopp |
be9a99 |
mch_exit(exitval);
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ #ifndef NO_VIM_MAIN
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Get a (optional) count for a Vim argument.
|
|
Karsten Hopp |
be9a99 |
*/
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 2994,2999 ****
|
|
Karsten Hopp |
be9a99 |
--- 2999,3006 ----
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ #endif /* NO_VIM_MAIN */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Get an environment variable, and execute it as Ex commands.
|
|
Karsten Hopp |
be9a99 |
* Returns FAIL if the environment variable was not executed, OK otherwise.
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3033,3039 ****
|
|
Karsten Hopp |
be9a99 |
return FAIL;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if defined(UNIX) || defined(VMS)
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Return TRUE if we are certain the user owns the file "fname".
|
|
Karsten Hopp |
be9a99 |
* Used for ".vimrc" and ".exrc".
|
|
Karsten Hopp |
be9a99 |
--- 3040,3046 ----
|
|
Karsten Hopp |
be9a99 |
return FAIL;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Return TRUE if we are certain the user owns the file "fname".
|
|
Karsten Hopp |
be9a99 |
* Used for ".vimrc" and ".exrc".
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3091,3096 ****
|
|
Karsten Hopp |
be9a99 |
--- 3098,3104 ----
|
|
Karsten Hopp |
be9a99 |
mainerr(ME_ARG_MISSING, str);
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ #ifndef NO_VIM_MAIN
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* print a message with three spaces prepended and '\n' appended.
|
|
Karsten Hopp |
be9a99 |
*/
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3311,3316 ****
|
|
Karsten Hopp |
be9a99 |
--- 3319,3326 ----
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
+ #endif
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
#if defined(STARTUPTIME) || defined(PROTO)
|
|
Karsten Hopp |
be9a99 |
static void time_diff __ARGS((struct timeval *then, struct timeval *now));
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3420,3426 ****
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Common code for the X command server and the Win32 command server.
|
|
Karsten Hopp |
be9a99 |
--- 3430,3436 ----
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
#endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! #if (defined(FEAT_CLIENTSERVER) && !defined(NO_VIM_MAIN)) || defined(PROTO)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* Common code for the X command server and the Win32 command server.
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3888,3893 ****
|
|
Karsten Hopp |
be9a99 |
--- 3898,3929 ----
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
+ * Make our basic server name: use the specified "arg" if given, otherwise use
|
|
Karsten Hopp |
be9a99 |
+ * the tail of the command "cmd" we were started with.
|
|
Karsten Hopp |
be9a99 |
+ * Return the name in allocated memory. This doesn't include a serial number.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static char_u *
|
|
Karsten Hopp |
be9a99 |
+ serverMakeName(arg, cmd)
|
|
Karsten Hopp |
be9a99 |
+ char_u *arg;
|
|
Karsten Hopp |
be9a99 |
+ char *cmd;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ char_u *p;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (arg != NULL && *arg != NUL)
|
|
Karsten Hopp |
be9a99 |
+ p = vim_strsave_up(arg);
|
|
Karsten Hopp |
be9a99 |
+ else
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ p = vim_strsave_up(gettail((char_u *)cmd));
|
|
Karsten Hopp |
be9a99 |
+ /* Remove .exe or .bat from the name. */
|
|
Karsten Hopp |
be9a99 |
+ if (p != NULL && vim_strchr(p, '.') != NULL)
|
|
Karsten Hopp |
be9a99 |
+ *vim_strchr(p, '.') = NUL;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ return p;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ #endif /* FEAT_CLIENTSERVER */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ #if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
* Replace termcodes such as <CR> and insert as key presses if there is room.
|
|
Karsten Hopp |
be9a99 |
*/
|
|
Karsten Hopp |
be9a99 |
void
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 3998,4029 ****
|
|
Karsten Hopp |
be9a99 |
# endif
|
|
Karsten Hopp |
be9a99 |
return res;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! /*
|
|
Karsten Hopp |
be9a99 |
! * Make our basic server name: use the specified "arg" if given, otherwise use
|
|
Karsten Hopp |
be9a99 |
! * the tail of the command "cmd" we were started with.
|
|
Karsten Hopp |
be9a99 |
! * Return the name in allocated memory. This doesn't include a serial number.
|
|
Karsten Hopp |
be9a99 |
! */
|
|
Karsten Hopp |
be9a99 |
! static char_u *
|
|
Karsten Hopp |
be9a99 |
! serverMakeName(arg, cmd)
|
|
Karsten Hopp |
be9a99 |
! char_u *arg;
|
|
Karsten Hopp |
be9a99 |
! char *cmd;
|
|
Karsten Hopp |
be9a99 |
! {
|
|
Karsten Hopp |
be9a99 |
! char_u *p;
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! if (arg != NULL && *arg != NUL)
|
|
Karsten Hopp |
be9a99 |
! p = vim_strsave_up(arg);
|
|
Karsten Hopp |
be9a99 |
! else
|
|
Karsten Hopp |
be9a99 |
! {
|
|
Karsten Hopp |
be9a99 |
! p = vim_strsave_up(gettail((char_u *)cmd));
|
|
Karsten Hopp |
be9a99 |
! /* Remove .exe or .bat from the name. */
|
|
Karsten Hopp |
be9a99 |
! if (p != NULL && vim_strchr(p, '.') != NULL)
|
|
Karsten Hopp |
be9a99 |
! *vim_strchr(p, '.') = NUL;
|
|
Karsten Hopp |
be9a99 |
! }
|
|
Karsten Hopp |
be9a99 |
! return p;
|
|
Karsten Hopp |
be9a99 |
! }
|
|
Karsten Hopp |
be9a99 |
! #endif /* FEAT_CLIENTSERVER */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* When FEAT_FKMAP is defined, also compile the Farsi source code.
|
|
Karsten Hopp |
be9a99 |
--- 4034,4040 ----
|
|
Karsten Hopp |
be9a99 |
# endif
|
|
Karsten Hopp |
be9a99 |
return res;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
! #endif
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* When FEAT_FKMAP is defined, also compile the Farsi source code.
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/memfile.c 2010-12-17 18:06:00.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/memfile.c 2011-03-03 18:47:39.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 84,89 ****
|
|
Karsten Hopp |
be9a99 |
--- 84,96 ----
|
|
Karsten Hopp |
be9a99 |
static int mf_write_block __ARGS((memfile_T *mfp, bhdr_T *hp, off_t offset, unsigned size));
|
|
Karsten Hopp |
be9a99 |
static int mf_trans_add __ARGS((memfile_T *, bhdr_T *));
|
|
Karsten Hopp |
be9a99 |
static void mf_do_open __ARGS((memfile_T *, char_u *, int));
|
|
Karsten Hopp |
be9a99 |
+ static void mf_hash_init __ARGS((mf_hashtab_T *));
|
|
Karsten Hopp |
be9a99 |
+ static void mf_hash_free __ARGS((mf_hashtab_T *));
|
|
Karsten Hopp |
be9a99 |
+ static void mf_hash_free_all __ARGS((mf_hashtab_T *));
|
|
Karsten Hopp |
be9a99 |
+ static mf_hashitem_T *mf_hash_find __ARGS((mf_hashtab_T *, blocknr_T));
|
|
Karsten Hopp |
be9a99 |
+ static void mf_hash_add_item __ARGS((mf_hashtab_T *, mf_hashitem_T *));
|
|
Karsten Hopp |
be9a99 |
+ static void mf_hash_rem_item __ARGS((mf_hashtab_T *, mf_hashitem_T *));
|
|
Karsten Hopp |
be9a99 |
+ static int mf_hash_grow __ARGS((mf_hashtab_T *));
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
* The functions for using a memfile:
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 119,125 ****
|
|
Karsten Hopp |
be9a99 |
int flags;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
- int i;
|
|
Karsten Hopp |
be9a99 |
off_t size;
|
|
Karsten Hopp |
be9a99 |
#if defined(STATFS) && defined(UNIX) && !defined(__QNX__)
|
|
Karsten Hopp |
be9a99 |
# define USE_FSTATFS
|
|
Karsten Hopp |
be9a99 |
--- 126,131 ----
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 152,162 ****
|
|
Karsten Hopp |
be9a99 |
mfp->mf_used_last = NULL;
|
|
Karsten Hopp |
be9a99 |
mfp->mf_dirty = FALSE;
|
|
Karsten Hopp |
be9a99 |
mfp->mf_used_count = 0;
|
|
Karsten Hopp |
be9a99 |
! for (i = 0; i < MEMHASHSIZE; ++i)
|
|
Karsten Hopp |
be9a99 |
! {
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_hash[i] = NULL; /* hash lists are empty */
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_trans[i] = NULL; /* trans lists are empty */
|
|
Karsten Hopp |
be9a99 |
! }
|
|
Karsten Hopp |
be9a99 |
mfp->mf_page_size = MEMFILE_PAGE_SIZE;
|
|
Karsten Hopp |
be9a99 |
#ifdef FEAT_CRYPT
|
|
Karsten Hopp |
be9a99 |
mfp->mf_old_key = NULL;
|
|
Karsten Hopp |
be9a99 |
--- 158,165 ----
|
|
Karsten Hopp |
be9a99 |
mfp->mf_used_last = NULL;
|
|
Karsten Hopp |
be9a99 |
mfp->mf_dirty = FALSE;
|
|
Karsten Hopp |
be9a99 |
mfp->mf_used_count = 0;
|
|
Karsten Hopp |
be9a99 |
! mf_hash_init(&mfp->mf_hash);
|
|
Karsten Hopp |
be9a99 |
! mf_hash_init(&mfp->mf_trans);
|
|
Karsten Hopp |
be9a99 |
mfp->mf_page_size = MEMFILE_PAGE_SIZE;
|
|
Karsten Hopp |
be9a99 |
#ifdef FEAT_CRYPT
|
|
Karsten Hopp |
be9a99 |
mfp->mf_old_key = NULL;
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 242,249 ****
|
|
Karsten Hopp |
be9a99 |
int del_file;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
bhdr_T *hp, *nextp;
|
|
Karsten Hopp |
be9a99 |
- NR_TRANS *tp, *tpnext;
|
|
Karsten Hopp |
be9a99 |
- int i;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
if (mfp == NULL) /* safety check */
|
|
Karsten Hopp |
be9a99 |
return;
|
|
Karsten Hopp |
be9a99 |
--- 245,250 ----
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 263,274 ****
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
while (mfp->mf_free_first != NULL) /* free entries in free list */
|
|
Karsten Hopp |
be9a99 |
vim_free(mf_rem_free(mfp));
|
|
Karsten Hopp |
be9a99 |
! for (i = 0; i < MEMHASHSIZE; ++i) /* free entries in trans lists */
|
|
Karsten Hopp |
be9a99 |
! for (tp = mfp->mf_trans[i]; tp != NULL; tp = tpnext)
|
|
Karsten Hopp |
be9a99 |
! {
|
|
Karsten Hopp |
be9a99 |
! tpnext = tp->nt_next;
|
|
Karsten Hopp |
be9a99 |
! vim_free(tp);
|
|
Karsten Hopp |
be9a99 |
! }
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp->mf_fname);
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp->mf_ffname);
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp);
|
|
Karsten Hopp |
be9a99 |
--- 264,271 ----
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
while (mfp->mf_free_first != NULL) /* free entries in free list */
|
|
Karsten Hopp |
be9a99 |
vim_free(mf_rem_free(mfp));
|
|
Karsten Hopp |
be9a99 |
! mf_hash_free(&mfp->mf_hash);
|
|
Karsten Hopp |
be9a99 |
! mf_hash_free_all(&mfp->mf_trans); /* free hashtable and its items */
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp->mf_fname);
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp->mf_ffname);
|
|
Karsten Hopp |
be9a99 |
vim_free(mfp);
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 743,758 ****
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
bhdr_T *hp;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! bhdr_T *hhp;
|
|
Karsten Hopp |
be9a99 |
! int hash;
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! hash = MEMHASH(hp->bh_bnum);
|
|
Karsten Hopp |
be9a99 |
! hhp = mfp->mf_hash[hash];
|
|
Karsten Hopp |
be9a99 |
! hp->bh_hash_next = hhp;
|
|
Karsten Hopp |
be9a99 |
! hp->bh_hash_prev = NULL;
|
|
Karsten Hopp |
be9a99 |
! if (hhp != NULL)
|
|
Karsten Hopp |
be9a99 |
! hhp->bh_hash_prev = hp;
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_hash[hash] = hp;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
--- 740,746 ----
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
bhdr_T *hp;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! mf_hash_add_item(&mfp->mf_hash, (mf_hashitem_T *)hp);
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 763,775 ****
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
bhdr_T *hp;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! if (hp->bh_hash_prev == NULL)
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_hash[MEMHASH(hp->bh_bnum)] = hp->bh_hash_next;
|
|
Karsten Hopp |
be9a99 |
! else
|
|
Karsten Hopp |
be9a99 |
! hp->bh_hash_prev->bh_hash_next = hp->bh_hash_next;
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! if (hp->bh_hash_next)
|
|
Karsten Hopp |
be9a99 |
! hp->bh_hash_next->bh_hash_prev = hp->bh_hash_prev;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
--- 751,757 ----
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
bhdr_T *hp;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! mf_hash_rem_item(&mfp->mf_hash, (mf_hashitem_T *)hp);
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 780,791 ****
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
blocknr_T nr;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! bhdr_T *hp;
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! for (hp = mfp->mf_hash[MEMHASH(nr)]; hp != NULL; hp = hp->bh_hash_next)
|
|
Karsten Hopp |
be9a99 |
! if (hp->bh_bnum == nr)
|
|
Karsten Hopp |
be9a99 |
! break;
|
|
Karsten Hopp |
be9a99 |
! return hp;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
--- 762,768 ----
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
blocknr_T nr;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! return (bhdr_T *)mf_hash_find(&mfp->mf_hash, nr);
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1187,1193 ****
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
bhdr_T *freep;
|
|
Karsten Hopp |
be9a99 |
blocknr_T new_bnum;
|
|
Karsten Hopp |
be9a99 |
- int hash;
|
|
Karsten Hopp |
be9a99 |
NR_TRANS *np;
|
|
Karsten Hopp |
be9a99 |
int page_count;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 1164,1169 ----
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1235,1246 ****
|
|
Karsten Hopp |
be9a99 |
hp->bh_bnum = new_bnum;
|
|
Karsten Hopp |
be9a99 |
mf_ins_hash(mfp, hp); /* insert in new hash list */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! hash = MEMHASH(np->nt_old_bnum); /* insert in trans list */
|
|
Karsten Hopp |
be9a99 |
! np->nt_next = mfp->mf_trans[hash];
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_trans[hash] = np;
|
|
Karsten Hopp |
be9a99 |
! if (np->nt_next != NULL)
|
|
Karsten Hopp |
be9a99 |
! np->nt_next->nt_prev = np;
|
|
Karsten Hopp |
be9a99 |
! np->nt_prev = NULL;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
return OK;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
--- 1211,1218 ----
|
|
Karsten Hopp |
be9a99 |
hp->bh_bnum = new_bnum;
|
|
Karsten Hopp |
be9a99 |
mf_ins_hash(mfp, hp); /* insert in new hash list */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! /* Insert "np" into "mf_trans" hashtable with key "np->nt_old_bnum" */
|
|
Karsten Hopp |
be9a99 |
! mf_hash_add_item(&mfp->mf_trans, (mf_hashitem_T *)np);
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
return OK;
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1255,1279 ****
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
blocknr_T old_nr;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
- int hash;
|
|
Karsten Hopp |
be9a99 |
NR_TRANS *np;
|
|
Karsten Hopp |
be9a99 |
blocknr_T new_bnum;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! hash = MEMHASH(old_nr);
|
|
Karsten Hopp |
be9a99 |
! for (np = mfp->mf_trans[hash]; np != NULL; np = np->nt_next)
|
|
Karsten Hopp |
be9a99 |
! if (np->nt_old_bnum == old_nr)
|
|
Karsten Hopp |
be9a99 |
! break;
|
|
Karsten Hopp |
be9a99 |
if (np == NULL) /* not found */
|
|
Karsten Hopp |
be9a99 |
return old_nr;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
mfp->mf_neg_count--;
|
|
Karsten Hopp |
be9a99 |
new_bnum = np->nt_new_bnum;
|
|
Karsten Hopp |
be9a99 |
! if (np->nt_prev != NULL) /* remove entry from the trans list */
|
|
Karsten Hopp |
be9a99 |
! np->nt_prev->nt_next = np->nt_next;
|
|
Karsten Hopp |
be9a99 |
! else
|
|
Karsten Hopp |
be9a99 |
! mfp->mf_trans[hash] = np->nt_next;
|
|
Karsten Hopp |
be9a99 |
! if (np->nt_next != NULL)
|
|
Karsten Hopp |
be9a99 |
! np->nt_next->nt_prev = np->nt_prev;
|
|
Karsten Hopp |
be9a99 |
vim_free(np);
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
return new_bnum;
|
|
Karsten Hopp |
be9a99 |
--- 1227,1246 ----
|
|
Karsten Hopp |
be9a99 |
memfile_T *mfp;
|
|
Karsten Hopp |
be9a99 |
blocknr_T old_nr;
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
NR_TRANS *np;
|
|
Karsten Hopp |
be9a99 |
blocknr_T new_bnum;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
! np = (NR_TRANS *)mf_hash_find(&mfp->mf_trans, old_nr);
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
if (np == NULL) /* not found */
|
|
Karsten Hopp |
be9a99 |
return old_nr;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
mfp->mf_neg_count--;
|
|
Karsten Hopp |
be9a99 |
new_bnum = np->nt_new_bnum;
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
! /* remove entry from the trans list */
|
|
Karsten Hopp |
be9a99 |
! mf_hash_rem_item(&mfp->mf_trans, (mf_hashitem_T *)np);
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
vim_free(np);
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
return new_bnum;
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 1397,1399 ****
|
|
Karsten Hopp |
be9a99 |
--- 1364,1570 ----
|
|
Karsten Hopp |
be9a99 |
mch_hide(mfp->mf_fname); /* try setting the 'hidden' flag */
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
}
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Implementation of mf_hashtab_T follows.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * The number of buckets in the hashtable is increased by a factor of
|
|
Karsten Hopp |
be9a99 |
+ * MHT_GROWTH_FACTOR when the average number of items per bucket
|
|
Karsten Hopp |
be9a99 |
+ * exceeds 2 ^ MHT_LOG_LOAD_FACTOR.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ #define MHT_LOG_LOAD_FACTOR 6
|
|
Karsten Hopp |
be9a99 |
+ #define MHT_GROWTH_FACTOR 2 /* must be a power of two */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Initialize an empty hash table.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_init(mht)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ vim_memset(mht, 0, sizeof(mf_hashtab_T));
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_buckets = mht->mht_small_buckets;
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_mask = MHT_INIT_SIZE - 1;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Free the array of a hash table. Does not free the items it contains!
|
|
Karsten Hopp |
be9a99 |
+ * The hash table must not be used again without another mf_hash_init() call.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_free(mht)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ if (mht->mht_buckets != mht->mht_small_buckets)
|
|
Karsten Hopp |
be9a99 |
+ vim_free(mht->mht_buckets);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Free the array of a hash table and all the items it contains.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_free_all(mht)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ long_u idx;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *next;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ for (idx = 0; idx <= mht->mht_mask; idx++)
|
|
Karsten Hopp |
be9a99 |
+ for (mhi = mht->mht_buckets[idx]; mhi != NULL; mhi = next)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ next = mhi->mhi_next;
|
|
Karsten Hopp |
be9a99 |
+ vim_free(mhi);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_free(mht);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Find "key" in hashtable "mht".
|
|
Karsten Hopp |
be9a99 |
+ * Returns a pointer to a mf_hashitem_T or NULL if the item was not found.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static mf_hashitem_T *
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_find(mht, key)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ blocknr_T key;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mhi = mht->mht_buckets[key & mht->mht_mask];
|
|
Karsten Hopp |
be9a99 |
+ while (mhi != NULL && mhi->mhi_key != key)
|
|
Karsten Hopp |
be9a99 |
+ mhi = mhi->mhi_next;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ return mhi;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Add item "mhi" to hashtable "mht".
|
|
Karsten Hopp |
be9a99 |
+ * "mhi" must not be NULL.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_add_item(mht, mhi)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ long_u idx;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ idx = mhi->mhi_key & mht->mht_mask;
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_next = mht->mht_buckets[idx];
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_prev = NULL;
|
|
Karsten Hopp |
be9a99 |
+ if (mhi->mhi_next != NULL)
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_next->mhi_prev = mhi;
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_buckets[idx] = mhi;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_count++;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Grow hashtable when we have more thank 2^MHT_LOG_LOAD_FACTOR
|
|
Karsten Hopp |
be9a99 |
+ * items per bucket on average
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ if (mht->mht_fixed == 0
|
|
Karsten Hopp |
be9a99 |
+ && (mht->mht_count >> MHT_LOG_LOAD_FACTOR) > mht->mht_mask)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ if (mf_hash_grow(mht) == FAIL)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ /* stop trying to grow after first failure to allocate memory */
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_fixed = 1;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Remove item "mhi" from hashtable "mht".
|
|
Karsten Hopp |
be9a99 |
+ * "mhi" must not be NULL and must have been inserted into "mht".
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_rem_item(mht, mhi)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ if (mhi->mhi_prev == NULL)
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_buckets[mhi->mhi_key & mht->mht_mask] = mhi->mhi_next;
|
|
Karsten Hopp |
be9a99 |
+ else
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_prev->mhi_next = mhi->mhi_next;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (mhi->mhi_next != NULL)
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_next->mhi_prev = mhi->mhi_prev;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_count--;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* We could shrink the table here, but it typically takes little memory,
|
|
Karsten Hopp |
be9a99 |
+ * so why bother? */
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Increase number of buckets in the hashtable by MHT_GROWTH_FACTOR and
|
|
Karsten Hopp |
be9a99 |
+ * rehash items.
|
|
Karsten Hopp |
be9a99 |
+ * Returns FAIL when out of memory.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static int
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_grow(mht)
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T *mht;
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ long_u i, j;
|
|
Karsten Hopp |
be9a99 |
+ int shift;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *tails[MHT_GROWTH_FACTOR];
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T **buckets;
|
|
Karsten Hopp |
be9a99 |
+ size_t size;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ size = (mht->mht_mask + 1) * MHT_GROWTH_FACTOR * sizeof(void *);
|
|
Karsten Hopp |
be9a99 |
+ buckets = (mf_hashitem_T **)lalloc_clear(size, FALSE);
|
|
Karsten Hopp |
be9a99 |
+ if (buckets == NULL)
|
|
Karsten Hopp |
be9a99 |
+ return FAIL;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ shift = 0;
|
|
Karsten Hopp |
be9a99 |
+ while ((mht->mht_mask >> shift) != 0)
|
|
Karsten Hopp |
be9a99 |
+ shift++;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ for (i = 0; i <= mht->mht_mask; i++)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Traverse the items in the i-th original bucket and move them into
|
|
Karsten Hopp |
be9a99 |
+ * MHT_GROWTH_FACTOR new buckets, preserving their relative order
|
|
Karsten Hopp |
be9a99 |
+ * within each new bucket. Preserving the order is important because
|
|
Karsten Hopp |
be9a99 |
+ * mf_get() tries to keep most recently used items at the front of
|
|
Karsten Hopp |
be9a99 |
+ * each bucket.
|
|
Karsten Hopp |
be9a99 |
+ *
|
|
Karsten Hopp |
be9a99 |
+ * Here we strongly rely on the fact the hashes are computed modulo
|
|
Karsten Hopp |
be9a99 |
+ * a power of two.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ vim_memset(tails, 0, sizeof(tails));
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ for (mhi = mht->mht_buckets[i]; mhi != NULL; mhi = mhi->mhi_next)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ j = (mhi->mhi_key >> shift) & (MHT_GROWTH_FACTOR - 1);
|
|
Karsten Hopp |
be9a99 |
+ if (tails[j] == NULL)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ buckets[i + (j << shift)] = mhi;
|
|
Karsten Hopp |
be9a99 |
+ tails[j] = mhi;
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_prev = NULL;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ else
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ tails[j]->mhi_next = mhi;
|
|
Karsten Hopp |
be9a99 |
+ mhi->mhi_prev = tails[j];
|
|
Karsten Hopp |
be9a99 |
+ tails[j] = mhi;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ for (j = 0; j < MHT_GROWTH_FACTOR; j++)
|
|
Karsten Hopp |
be9a99 |
+ if (tails[j] != NULL)
|
|
Karsten Hopp |
be9a99 |
+ tails[j]->mhi_next = NULL;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (mht->mht_buckets != mht->mht_small_buckets)
|
|
Karsten Hopp |
be9a99 |
+ vim_free(mht->mht_buckets);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_buckets = buckets;
|
|
Karsten Hopp |
be9a99 |
+ mht->mht_mask = (mht->mht_mask + 1) * MHT_GROWTH_FACTOR - 1;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ return OK;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/memfile_test.c 2011-03-03 21:58:14.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/memfile_test.c 2011-03-03 20:40:29.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 0 ****
|
|
Karsten Hopp |
be9a99 |
--- 1,145 ----
|
|
Karsten Hopp |
be9a99 |
+ /* vi:set ts=8 sts=4 sw=4:
|
|
Karsten Hopp |
be9a99 |
+ *
|
|
Karsten Hopp |
be9a99 |
+ * VIM - Vi IMproved by Bram Moolenaar
|
|
Karsten Hopp |
be9a99 |
+ *
|
|
Karsten Hopp |
be9a99 |
+ * Do ":help uganda" in Vim to read copying and usage conditions.
|
|
Karsten Hopp |
be9a99 |
+ * Do ":help credits" in Vim to see a list of people who contributed.
|
|
Karsten Hopp |
be9a99 |
+ * See README.txt for an overview of the Vim source code.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * memfile_test.c: Unittests for memfile.c
|
|
Karsten Hopp |
be9a99 |
+ * Mostly by Ivan Krasilnikov.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ #undef NDEBUG
|
|
Karsten Hopp |
be9a99 |
+ #include <assert.h>
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* Must include main.c because it contains much more than just main() */
|
|
Karsten Hopp |
be9a99 |
+ #define NO_VIM_MAIN
|
|
Karsten Hopp |
be9a99 |
+ #include "main.c"
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* This file has to be included because the tested functions are static */
|
|
Karsten Hopp |
be9a99 |
+ #include "memfile.c"
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ #define index_to_key(i) ((i) ^ 15167)
|
|
Karsten Hopp |
be9a99 |
+ #define TEST_COUNT 50000
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ static void test_mf_hash __ARGS((void));
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
+ * Test mf_hash_*() functions.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+ static void
|
|
Karsten Hopp |
be9a99 |
+ test_mf_hash()
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ mf_hashtab_T ht;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *item;
|
|
Karsten Hopp |
be9a99 |
+ blocknr_T key;
|
|
Karsten Hopp |
be9a99 |
+ long_u i;
|
|
Karsten Hopp |
be9a99 |
+ long_u num_buckets;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_init(&ht;;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* insert some items and check invariants */
|
|
Karsten Hopp |
be9a99 |
+ for (i = 0; i < TEST_COUNT; i++)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ assert(ht.mht_count == i);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* check that number of buckets is a power of 2 */
|
|
Karsten Hopp |
be9a99 |
+ num_buckets = ht.mht_mask + 1;
|
|
Karsten Hopp |
be9a99 |
+ assert(num_buckets > 0 && (num_buckets & (num_buckets - 1)) == 0);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* check load factor */
|
|
Karsten Hopp |
be9a99 |
+ assert(ht.mht_count <= (num_buckets << MHT_LOG_LOAD_FACTOR));
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (i < (MHT_INIT_SIZE << MHT_LOG_LOAD_FACTOR))
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ /* first expansion shouldn't have occurred yet */
|
|
Karsten Hopp |
be9a99 |
+ assert(num_buckets == MHT_INIT_SIZE);
|
|
Karsten Hopp |
be9a99 |
+ assert(ht.mht_buckets == ht.mht_small_buckets);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ else
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ assert(num_buckets > MHT_INIT_SIZE);
|
|
Karsten Hopp |
be9a99 |
+ assert(ht.mht_buckets != ht.mht_small_buckets);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ key = index_to_key(i);
|
|
Karsten Hopp |
be9a99 |
+ assert(mf_hash_find(&ht, key) == NULL);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* allocate and add new item */
|
|
Karsten Hopp |
be9a99 |
+ item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);
|
|
Karsten Hopp |
be9a99 |
+ assert(item != NULL);
|
|
Karsten Hopp |
be9a99 |
+ item->mhi_key = key;
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_add_item(&ht, item);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ assert(mf_hash_find(&ht, key) == item);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (ht.mht_mask + 1 != num_buckets)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ /* hash table was expanded */
|
|
Karsten Hopp |
be9a99 |
+ assert(ht.mht_mask + 1 == num_buckets * MHT_GROWTH_FACTOR);
|
|
Karsten Hopp |
be9a99 |
+ assert(i + 1 == (num_buckets << MHT_LOG_LOAD_FACTOR));
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* check presence of inserted items */
|
|
Karsten Hopp |
be9a99 |
+ for (i = 0; i < TEST_COUNT; i++)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ key = index_to_key(i);
|
|
Karsten Hopp |
be9a99 |
+ item = mf_hash_find(&ht, key);
|
|
Karsten Hopp |
be9a99 |
+ assert(item != NULL);
|
|
Karsten Hopp |
be9a99 |
+ assert(item->mhi_key == key);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* delete some items */
|
|
Karsten Hopp |
be9a99 |
+ for (i = 0; i < TEST_COUNT; i++)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ if (i % 100 < 70)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ key = index_to_key(i);
|
|
Karsten Hopp |
be9a99 |
+ item = mf_hash_find(&ht, key);
|
|
Karsten Hopp |
be9a99 |
+ assert(item != NULL);
|
|
Karsten Hopp |
be9a99 |
+ assert(item->mhi_key == key);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_rem_item(&ht, item);
|
|
Karsten Hopp |
be9a99 |
+ assert(mf_hash_find(&ht, key) == NULL);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_add_item(&ht, item);
|
|
Karsten Hopp |
be9a99 |
+ assert(mf_hash_find(&ht, key) == item);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_rem_item(&ht, item);
|
|
Karsten Hopp |
be9a99 |
+ assert(mf_hash_find(&ht, key) == NULL);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ vim_free(item);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* check again */
|
|
Karsten Hopp |
be9a99 |
+ for (i = 0; i < TEST_COUNT; i++)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ key = index_to_key(i);
|
|
Karsten Hopp |
be9a99 |
+ item = mf_hash_find(&ht, key);
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ if (i % 100 < 70)
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ assert(item == NULL);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ else
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ assert(item != NULL);
|
|
Karsten Hopp |
be9a99 |
+ assert(item->mhi_key == key);
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /* free hash table and all remaining items */
|
|
Karsten Hopp |
be9a99 |
+ mf_hash_free_all(&ht;;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ int
|
|
Karsten Hopp |
be9a99 |
+ main()
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ test_mf_hash();
|
|
Karsten Hopp |
be9a99 |
+ return 0;
|
|
Karsten Hopp |
be9a99 |
+ }
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/structs.h 2011-02-15 17:39:14.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/structs.h 2011-03-03 18:49:01.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 378,383 ****
|
|
Karsten Hopp |
be9a99 |
--- 378,412 ----
|
|
Karsten Hopp |
be9a99 |
typedef long blocknr_T;
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/*
|
|
Karsten Hopp |
be9a99 |
+ * mf_hashtab_T is a chained hashtable with blocknr_T key and arbitrary
|
|
Karsten Hopp |
be9a99 |
+ * structures as items. This is an intrusive data structure: we require
|
|
Karsten Hopp |
be9a99 |
+ * that items begin with mf_hashitem_T which contains the key and linked
|
|
Karsten Hopp |
be9a99 |
+ * list pointers. List of items in each bucket is doubly-linked.
|
|
Karsten Hopp |
be9a99 |
+ */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ typedef struct mf_hashitem_S mf_hashitem_T;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ struct mf_hashitem_S
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi_next;
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mhi_prev;
|
|
Karsten Hopp |
be9a99 |
+ blocknr_T mhi_key;
|
|
Karsten Hopp |
be9a99 |
+ };
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ #define MHT_INIT_SIZE 64
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ typedef struct mf_hashtab_S
|
|
Karsten Hopp |
be9a99 |
+ {
|
|
Karsten Hopp |
be9a99 |
+ long_u mht_mask; /* mask used for hash value (nr of items
|
|
Karsten Hopp |
be9a99 |
+ * in array is "mht_mask" + 1) */
|
|
Karsten Hopp |
be9a99 |
+ long_u mht_count; /* nr of items inserted into hashtable */
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T **mht_buckets; /* points to mht_small_buckets or
|
|
Karsten Hopp |
be9a99 |
+ *dynamically allocated array */
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T *mht_small_buckets[MHT_INIT_SIZE]; /* initial buckets */
|
|
Karsten Hopp |
be9a99 |
+ char mht_fixed; /* non-zero value forbids growth */
|
|
Karsten Hopp |
be9a99 |
+ } mf_hashtab_T;
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ /*
|
|
Karsten Hopp |
be9a99 |
* for each (previously) used block in the memfile there is one block header.
|
|
Karsten Hopp |
be9a99 |
*
|
|
Karsten Hopp |
be9a99 |
* The block may be linked in the used list OR in the free list.
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 394,404 ****
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
struct block_hdr
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
bhdr_T *bh_next; /* next block_hdr in free or used list */
|
|
Karsten Hopp |
be9a99 |
bhdr_T *bh_prev; /* previous block_hdr in used list */
|
|
Karsten Hopp |
be9a99 |
- bhdr_T *bh_hash_next; /* next block_hdr in hash list */
|
|
Karsten Hopp |
be9a99 |
- bhdr_T *bh_hash_prev; /* previous block_hdr in hash list */
|
|
Karsten Hopp |
be9a99 |
- blocknr_T bh_bnum; /* block number */
|
|
Karsten Hopp |
be9a99 |
char_u *bh_data; /* pointer to memory (for used block) */
|
|
Karsten Hopp |
be9a99 |
int bh_page_count; /* number of pages in this block */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 423,433 ----
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
struct block_hdr
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
+ mf_hashitem_T bh_hashitem; /* header for hash table and key */
|
|
Karsten Hopp |
be9a99 |
+ #define bh_bnum bh_hashitem.mhi_key /* block number, part of bh_hashitem */
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
bhdr_T *bh_next; /* next block_hdr in free or used list */
|
|
Karsten Hopp |
be9a99 |
bhdr_T *bh_prev; /* previous block_hdr in used list */
|
|
Karsten Hopp |
be9a99 |
char_u *bh_data; /* pointer to memory (for used block) */
|
|
Karsten Hopp |
be9a99 |
int bh_page_count; /* number of pages in this block */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 417,425 ****
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
struct nr_trans
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! NR_TRANS *nt_next; /* next nr_trans in hash list */
|
|
Karsten Hopp |
be9a99 |
! NR_TRANS *nt_prev; /* previous nr_trans in hash list */
|
|
Karsten Hopp |
be9a99 |
! blocknr_T nt_old_bnum; /* old, negative, number */
|
|
Karsten Hopp |
be9a99 |
blocknr_T nt_new_bnum; /* new, positive, number */
|
|
Karsten Hopp |
be9a99 |
};
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 446,454 ----
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
struct nr_trans
|
|
Karsten Hopp |
be9a99 |
{
|
|
Karsten Hopp |
be9a99 |
! mf_hashitem_T nt_hashitem; /* header for hash table and key */
|
|
Karsten Hopp |
be9a99 |
! #define nt_old_bnum nt_hashitem.mhi_key /* old, negative, number */
|
|
Karsten Hopp |
be9a99 |
!
|
|
Karsten Hopp |
be9a99 |
blocknr_T nt_new_bnum; /* new, positive, number */
|
|
Karsten Hopp |
be9a99 |
};
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 499,510 ****
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
typedef struct file_buffer buf_T; /* forward declaration */
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
- /*
|
|
Karsten Hopp |
be9a99 |
- * Simplistic hashing scheme to quickly locate the blocks in the used list.
|
|
Karsten Hopp |
be9a99 |
- * 64 blocks are found directly (64 * 4K = 256K, most files are smaller).
|
|
Karsten Hopp |
be9a99 |
- */
|
|
Karsten Hopp |
be9a99 |
- #define MEMHASHSIZE 64
|
|
Karsten Hopp |
be9a99 |
- #define MEMHASH(nr) ((nr) & (MEMHASHSIZE - 1))
|
|
Karsten Hopp |
be9a99 |
#define MF_SEED_LEN 8
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
struct memfile
|
|
Karsten Hopp |
be9a99 |
--- 528,533 ----
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 517,524 ****
|
|
Karsten Hopp |
be9a99 |
bhdr_T *mf_used_last; /* lru block_hdr in used list */
|
|
Karsten Hopp |
be9a99 |
unsigned mf_used_count; /* number of pages in used list */
|
|
Karsten Hopp |
be9a99 |
unsigned mf_used_count_max; /* maximum number of pages in memory */
|
|
Karsten Hopp |
be9a99 |
! bhdr_T *mf_hash[MEMHASHSIZE]; /* array of hash lists */
|
|
Karsten Hopp |
be9a99 |
! NR_TRANS *mf_trans[MEMHASHSIZE]; /* array of trans lists */
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_blocknr_max; /* highest positive block number + 1*/
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_blocknr_min; /* lowest negative block number - 1 */
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_neg_count; /* number of negative blocks numbers */
|
|
Karsten Hopp |
be9a99 |
--- 540,547 ----
|
|
Karsten Hopp |
be9a99 |
bhdr_T *mf_used_last; /* lru block_hdr in used list */
|
|
Karsten Hopp |
be9a99 |
unsigned mf_used_count; /* number of pages in used list */
|
|
Karsten Hopp |
be9a99 |
unsigned mf_used_count_max; /* maximum number of pages in memory */
|
|
Karsten Hopp |
be9a99 |
! mf_hashtab_T mf_hash; /* hash lists */
|
|
Karsten Hopp |
be9a99 |
! mf_hashtab_T mf_trans; /* trans lists */
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_blocknr_max; /* highest positive block number + 1*/
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_blocknr_min; /* lowest negative block number - 1 */
|
|
Karsten Hopp |
be9a99 |
blocknr_T mf_neg_count; /* number of negative blocks numbers */
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/Make_amiga.mak 2010-11-10 16:54:16.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/Make_amiga.mak 2011-03-03 17:04:14.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 28,34 ****
|
|
Karsten Hopp |
be9a99 |
test61.out test62.out test63.out test64.out test65.out \
|
|
Karsten Hopp |
be9a99 |
test66.out test67.out test68.out test69.out test70.out \
|
|
Karsten Hopp |
be9a99 |
test71.out test72.out test73.out test74.out test75.out \
|
|
Karsten Hopp |
be9a99 |
! test76.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
.SUFFIXES: .in .out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 28,34 ----
|
|
Karsten Hopp |
be9a99 |
test61.out test62.out test63.out test64.out test65.out \
|
|
Karsten Hopp |
be9a99 |
test66.out test67.out test68.out test69.out test70.out \
|
|
Karsten Hopp |
be9a99 |
test71.out test72.out test73.out test74.out test75.out \
|
|
Karsten Hopp |
be9a99 |
! test76.out test77.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
.SUFFIXES: .in .out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 124,126 ****
|
|
Karsten Hopp |
be9a99 |
--- 124,127 ----
|
|
Karsten Hopp |
be9a99 |
test74.out: test74.in
|
|
Karsten Hopp |
be9a99 |
test75.out: test75.in
|
|
Karsten Hopp |
be9a99 |
test76.out: test76.in
|
|
Karsten Hopp |
be9a99 |
+ test77.out: test77.in
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/Make_dos.mak 2010-11-10 16:54:16.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/Make_dos.mak 2011-03-03 17:04:20.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 28,34 ****
|
|
Karsten Hopp |
be9a99 |
test37.out test38.out test39.out test40.out test41.out \
|
|
Karsten Hopp |
be9a99 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
be9a99 |
test68.out test69.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 28,34 ----
|
|
Karsten Hopp |
be9a99 |
test37.out test38.out test39.out test40.out test41.out \
|
|
Karsten Hopp |
be9a99 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
be9a99 |
test68.out test69.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out test77.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/Make_ming.mak 2010-11-10 16:54:16.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/Make_ming.mak 2011-03-03 17:04:32.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 48,54 ****
|
|
Karsten Hopp |
be9a99 |
test37.out test38.out test39.out test40.out test41.out \
|
|
Karsten Hopp |
be9a99 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
be9a99 |
test68.out test69.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 48,54 ----
|
|
Karsten Hopp |
be9a99 |
test37.out test38.out test39.out test40.out test41.out \
|
|
Karsten Hopp |
be9a99 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
be9a99 |
test68.out test69.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out test77.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/Make_os2.mak 2010-11-10 16:54:16.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/Make_os2.mak 2011-03-03 17:04:48.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 28,34 ****
|
|
Karsten Hopp |
be9a99 |
test61.out test62.out test63.out test64.out test65.out \
|
|
Karsten Hopp |
be9a99 |
test66.out test67.out test68.out test69.out test70.out \
|
|
Karsten Hopp |
be9a99 |
test71.out test72.out test73.out test74.out test75.out \
|
|
Karsten Hopp |
be9a99 |
! test76.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
.SUFFIXES: .in .out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 28,34 ----
|
|
Karsten Hopp |
be9a99 |
test61.out test62.out test63.out test64.out test65.out \
|
|
Karsten Hopp |
be9a99 |
test66.out test67.out test68.out test69.out test70.out \
|
|
Karsten Hopp |
be9a99 |
test71.out test72.out test73.out test74.out test75.out \
|
|
Karsten Hopp |
be9a99 |
! test76.out test77.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
.SUFFIXES: .in .out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/Makefile 2010-11-10 16:54:16.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/Makefile 2011-03-22 17:03:25.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 25,31 ****
|
|
Karsten Hopp |
be9a99 |
test59.out test60.out test61.out test62.out test63.out \
|
|
Karsten Hopp |
be9a99 |
test64.out test65.out test66.out test67.out test68.out \
|
|
Karsten Hopp |
be9a99 |
test69.out test70.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 25,31 ----
|
|
Karsten Hopp |
be9a99 |
test59.out test60.out test61.out test62.out test63.out \
|
|
Karsten Hopp |
be9a99 |
test64.out test65.out test66.out test67.out test68.out \
|
|
Karsten Hopp |
be9a99 |
test69.out test70.out test71.out test72.out test73.out \
|
|
Karsten Hopp |
be9a99 |
! test74.out test75.out test76.out test77.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 71,77 ****
|
|
Karsten Hopp |
be9a99 |
fi \
|
|
Karsten Hopp |
be9a99 |
else echo $* NO OUTPUT >>test.log; \
|
|
Karsten Hopp |
be9a99 |
fi"
|
|
Karsten Hopp |
be9a99 |
! -rm -rf X* test.ok viminfo
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
test49.out: test49.vim
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--- 71,77 ----
|
|
Karsten Hopp |
be9a99 |
fi \
|
|
Karsten Hopp |
be9a99 |
else echo $* NO OUTPUT >>test.log; \
|
|
Karsten Hopp |
be9a99 |
fi"
|
|
Karsten Hopp |
be9a99 |
! # -rm -rf X* test.ok viminfo
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
test49.out: test49.vim
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/test77.in 2011-03-03 21:59:10.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/test77.in 2011-03-22 17:12:38.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 0 ****
|
|
Karsten Hopp |
be9a99 |
--- 1,27 ----
|
|
Karsten Hopp |
be9a99 |
+ Inserts 2 million lines with consecutive integers starting from 1
|
|
Karsten Hopp |
be9a99 |
+ (essentially, the output of GNU's seq 1 2000000), writes them to Xtest
|
|
Karsten Hopp |
be9a99 |
+ and writes its cksum to test.out.
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
|
|
Karsten Hopp |
be9a99 |
+ up the lines the checksum would differ.
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ cksum is part of POSIX and so should be available on most Unixes.
|
|
Karsten Hopp |
be9a99 |
+ If it isn't available then the test will be skipped.
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
+ STARTTEST
|
|
Karsten Hopp |
be9a99 |
+ :so small.vim
|
|
Karsten Hopp |
be9a99 |
+ :if !executable("cksum")
|
|
Karsten Hopp |
be9a99 |
+ : e! test.ok
|
|
Karsten Hopp |
be9a99 |
+ : w! test.out
|
|
Karsten Hopp |
be9a99 |
+ : qa!
|
|
Karsten Hopp |
be9a99 |
+ :endif
|
|
Karsten Hopp |
be9a99 |
+ :set fileformat=unix undolevels=-1
|
|
Karsten Hopp |
be9a99 |
+ ggdG
|
|
Karsten Hopp |
be9a99 |
+ :let i = 1
|
|
Karsten Hopp |
be9a99 |
+ :while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile
|
|
Karsten Hopp |
be9a99 |
+ ggdd
|
|
Karsten Hopp |
be9a99 |
+ :w! Xtest
|
|
Karsten Hopp |
be9a99 |
+ :!cksum Xtest > test.out
|
|
Karsten Hopp |
be9a99 |
+ :qa!
|
|
Karsten Hopp |
be9a99 |
+ ENDTEST
|
|
Karsten Hopp |
be9a99 |
+
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/testdir/test77.ok 2011-03-03 21:59:10.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/testdir/test77.ok 2011-03-22 17:10:14.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 0 ****
|
|
Karsten Hopp |
be9a99 |
--- 1 ----
|
|
Karsten Hopp |
be9a99 |
+ 3678979763 14888896 Xtest
|
|
Karsten Hopp |
be9a99 |
*** ../vim-7.3.142/src/version.c 2011-03-22 15:47:18.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
--- src/version.c 2011-03-22 18:01:48.000000000 +0100
|
|
Karsten Hopp |
be9a99 |
***************
|
|
Karsten Hopp |
be9a99 |
*** 716,717 ****
|
|
Karsten Hopp |
be9a99 |
--- 716,719 ----
|
|
Karsten Hopp |
be9a99 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
be9a99 |
+ /**/
|
|
Karsten Hopp |
be9a99 |
+ 143,
|
|
Karsten Hopp |
be9a99 |
/**/
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
--
|
|
Karsten Hopp |
be9a99 |
SIGIRO -- irony detected (iron core dumped)
|
|
Karsten Hopp |
be9a99 |
|
|
Karsten Hopp |
be9a99 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
be9a99 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
be9a99 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
be9a99 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|