0
0
mirror of https://github.com/vim/vim.git synced 2025-09-04 21:33:48 -04:00

updated for version 7.0054

This commit is contained in:
Bram Moolenaar 2005-02-28 22:44:58 +00:00
parent 4d01d630a5
commit 8cd06cabf3
10 changed files with 141 additions and 18 deletions

View File

@ -1,4 +1,4 @@
*repeat.txt* For Vim version 7.0aa. Last change: 2005 Feb 26 *repeat.txt* For Vim version 7.0aa. Last change: 2005 Feb 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -572,7 +572,8 @@ It is only included when Vim was compiled with "huge" features.
This only profiles the script itself, not the functions This only profiles the script itself, not the functions
defined in it. defined in it.
When the [!] is added then all functions defined in the script When the [!] is added then all functions defined in the script
will also be profiled. will also be profiled. But only if the script is loaded after
this command.
You must always start with a ":profile start fname" command. The resulting You must always start with a ":profile start fname" command. The resulting
@ -632,5 +633,7 @@ mind there are various things that may clobber the results:
: delfunc MyFunc : delfunc MyFunc
:endif :endif
< <
- Profiling may give weird results on multi-processor systems, when sleep
mode kicks in or the processor frequency is reduced to save power.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -254,14 +254,14 @@ endif
CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
ifdef GETTEXT ifdef GETTEXT
DEFINES +=-DHAVE_GETTEXT -DHAVE_LOCALE_H DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
GETTEXTINCLUDE = $(GETTEXT)/include GETTEXTINCLUDE = $(GETTEXT)/include
GETTEXTLIB = $(INTLPATH) GETTEXTLIB = $(INTLPATH)
ifeq (yes, $(GETTEXT)) ifeq (yes, $(GETTEXT))
DEFINES +=-DDYNAMIC_GETTEXT DEFINES += -DDYNAMIC_GETTEXT
else else
ifdef DYNAMIC_GETTEXT ifdef DYNAMIC_GETTEXT
DEFINES +=-D$(DYNAMIC_GETTEXT) DEFINES += -D$(DYNAMIC_GETTEXT)
ifdef GETTEXT_DYNAMIC ifdef GETTEXT_DYNAMIC
DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\" DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
endif endif

View File

@ -26,7 +26,7 @@
static void cmd_source __ARGS((char_u *fname, exarg_T *eap)); static void cmd_source __ARGS((char_u *fname, exarg_T *eap));
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
/* Growarray to store the names of sourced scripts. /* Growarray to store info about already sourced scripts.
* For Unix also store the dev/ino, so that we don't have to stat() each * For Unix also store the dev/ino, so that we don't have to stat() each
* script when going through the list. */ * script when going through the list. */
typedef struct scriptitem_S typedef struct scriptitem_S
@ -38,7 +38,7 @@ typedef struct scriptitem_S
# endif # endif
# ifdef FEAT_PROFILE # ifdef FEAT_PROFILE
int sn_prof_on; /* TRUE when script is/was profiled */ int sn_prof_on; /* TRUE when script is/was profiled */
int sn_pr_force; /* forceit: profile defined functions */ int sn_pr_force; /* forceit: profile functions in this script */
proftime_T sn_pr_child; /* time set when going into first child */ proftime_T sn_pr_child; /* time set when going into first child */
int sn_pr_nest; /* nesting for sn_pr_child */ int sn_pr_nest; /* nesting for sn_pr_child */
/* profiling the script as a whole */ /* profiling the script as a whole */
@ -802,8 +802,12 @@ static proftime_T prof_wait_time;
profile_zero(tm) profile_zero(tm)
proftime_T *tm; proftime_T *tm;
{ {
# ifdef WIN3264
tm->QuadPart = 0;
# else
tm->tv_usec = 0; tm->tv_usec = 0;
tm->tv_sec = 0; tm->tv_sec = 0;
# endif
} }
/* /*
@ -813,7 +817,11 @@ profile_zero(tm)
profile_start(tm) profile_start(tm)
proftime_T *tm; proftime_T *tm;
{ {
# ifdef WIN3264
QueryPerformanceCounter(tm);
# else
gettimeofday(tm, NULL); gettimeofday(tm, NULL);
# endif
} }
/* /*
@ -825,6 +833,10 @@ profile_end(tm)
{ {
proftime_T now; proftime_T now;
# ifdef WIN3264
QueryPerformanceCounter(&now);
tm->QuadPart = now.QuadPart - tm->QuadPart;
# else
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
tm->tv_usec = now.tv_usec - tm->tv_usec; tm->tv_usec = now.tv_usec - tm->tv_usec;
tm->tv_sec = now.tv_sec - tm->tv_sec; tm->tv_sec = now.tv_sec - tm->tv_sec;
@ -833,6 +845,7 @@ profile_end(tm)
tm->tv_usec += 1000000; tm->tv_usec += 1000000;
--tm->tv_sec; --tm->tv_sec;
} }
# endif
} }
/* /*
@ -842,6 +855,9 @@ profile_end(tm)
profile_sub(tm, tm2) profile_sub(tm, tm2)
proftime_T *tm, *tm2; proftime_T *tm, *tm2;
{ {
# ifdef WIN3264
tm->QuadPart -= tm2->QuadPart;
# else
tm->tv_usec -= tm2->tv_usec; tm->tv_usec -= tm2->tv_usec;
tm->tv_sec -= tm2->tv_sec; tm->tv_sec -= tm2->tv_sec;
if (tm->tv_usec < 0) if (tm->tv_usec < 0)
@ -849,6 +865,7 @@ profile_sub(tm, tm2)
tm->tv_usec += 1000000; tm->tv_usec += 1000000;
--tm->tv_sec; --tm->tv_sec;
} }
# endif
} }
/* /*
@ -858,6 +875,9 @@ profile_sub(tm, tm2)
profile_add(tm, tm2) profile_add(tm, tm2)
proftime_T *tm, *tm2; proftime_T *tm, *tm2;
{ {
# ifdef WIN3264
tm->QuadPart += tm2->QuadPart;
# else
tm->tv_usec += tm2->tv_usec; tm->tv_usec += tm2->tv_usec;
tm->tv_sec += tm2->tv_sec; tm->tv_sec += tm2->tv_sec;
if (tm->tv_usec >= 1000000) if (tm->tv_usec >= 1000000)
@ -865,6 +885,7 @@ profile_add(tm, tm2)
tm->tv_usec -= 1000000; tm->tv_usec -= 1000000;
++tm->tv_sec; ++tm->tv_sec;
} }
# endif
} }
/* /*
@ -897,7 +918,27 @@ profile_sub_wait(tm, tma)
profile_equal(tm1, tm2) profile_equal(tm1, tm2)
proftime_T *tm1, *tm2; proftime_T *tm1, *tm2;
{ {
# ifdef WIN3264
return (tm1->QuadPart == tm2->QuadPart);
# else
return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec); return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec);
# endif
}
/*
* Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2"
*/
int
profile_cmp(tm1, tm2)
proftime_T *tm1, *tm2;
{
# ifdef WIN3264
return (int)(tm2->QuadPart - tm1->QuadPart);
# else
if (tm1->tv_sec == tm2->tv_sec)
return tm2->tv_usec - tm1->tv_usec;
return tm2->tv_sec - tm1->tv_sec;
# endif
} }
/* /*
@ -910,7 +951,14 @@ profile_msg(tm)
{ {
static char buf[50]; static char buf[50];
# ifdef WIN3264
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
# else
sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec); sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
#endif
return buf; return buf;
} }
@ -962,8 +1010,8 @@ profile_dump()
EMSG2(_(e_notopen), profile_fname); EMSG2(_(e_notopen), profile_fname);
else else
{ {
func_dump_profile(fd);
script_dump_profile(fd); script_dump_profile(fd);
func_dump_profile(fd);
fclose(fd); fclose(fd);
} }
} }

View File

@ -1,4 +1,4 @@
/* vi:set ts=8 sts=0 sw=8: /* vi:set ts=8 sts=4 sw=4:
* *
* VIM - Vi IMproved by Bram Moolenaar * VIM - Vi IMproved by Bram Moolenaar
* *
@ -382,7 +382,9 @@
/* /*
* +profile Profiling for functions and scripts. * +profile Profiling for functions and scripts.
*/ */
#if defined(FEAT_HUGE) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) #if defined(FEAT_HUGE) \
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
|| defined(WIN3264))
# define FEAT_PROFILE # define FEAT_PROFILE
#endif #endif

View File

@ -1333,10 +1333,19 @@ retry:
* If there is conversion error or not enough room try using * If there is conversion error or not enough room try using
* another conversion. * another conversion.
*/ */
if ((iconv(iconv_fd, (void *)&fromp, &from_size, &top, &to_size) while ((iconv(iconv_fd, (void *)&fromp, &from_size,
&top, &to_size)
== (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL) == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
|| from_size > CONV_RESTLEN) || from_size > CONV_RESTLEN)
goto rewind_retry; {
if (!keep_dest_enc)
goto rewind_retry;
/* Ignore a byte and try again. */
++fromp;
--from_size;
*top++ = '?';
--to_size;
}
if (from_size > 0) if (from_size > 0)
{ {

View File

@ -656,10 +656,10 @@ EXTERN JMP_BUF x_jump_env;
* Used to protect areas where we could crash. * Used to protect areas where we could crash.
*/ */
EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */ EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */
#ifdef SIGHASARG # ifdef SIGHASARG
EXTERN int lc_signal; /* catched signal number, 0 when no was signal EXTERN int lc_signal; /* catched signal number, 0 when no was signal
catched; used for mch_libcall() */ catched; used for mch_libcall() */
#endif # endif
EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */ EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
#endif #endif
@ -1412,7 +1412,7 @@ EXTERN char_u e_nbreadonly[] INIT(=N_("E744: NetBeans does not allow changes in
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO) #if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s")); EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s"));
#endif #endif
#if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT) #if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT) || defined(__MINGW32__)
EXTERN char_u e_complex[] INIT(=N_("E361: Crash intercepted; regexp too complex?")); EXTERN char_u e_complex[] INIT(=N_("E361: Crash intercepted; regexp too complex?"));
#endif #endif
EXTERN char_u e_outofstack[] INIT(=N_("E363: pattern caused out-of-stack error")); EXTERN char_u e_outofstack[] INIT(=N_("E363: pattern caused out-of-stack error"));

View File

@ -3830,6 +3830,7 @@ mch_call_shell(cmd, options)
size_t l; size_t l;
/* child */ /* child */
close(fromshell_fd);
for (;;) for (;;)
{ {
l = STRLEN(p + written); l = STRLEN(p + written);

View File

@ -2514,7 +2514,7 @@ jumpend:
{ {
/* The buffer is still loaded, the Filetype autocommands /* The buffer is still loaded, the Filetype autocommands
* need to be done now, in that buffer. And then the * need to be done now, in that buffer. And then the
* modelines (again). */ * modelines need to be done (again). */
aucmd_prepbuf(&aco, buf); aucmd_prepbuf(&aco, buf);
apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, apply_autocmds(EVENT_FILETYPE, buf->b_p_ft,
buf->b_fname, TRUE, buf); buf->b_fname, TRUE, buf);
@ -2632,6 +2632,9 @@ load_dummy_buffer(fname)
if (newbuf == NULL) if (newbuf == NULL)
return NULL; return NULL;
/* Init the options. */
buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
/* set curwin/curbuf to buf and save a few things */ /* set curwin/curbuf to buf and save a few things */
aucmd_prepbuf(&aco, newbuf); aucmd_prepbuf(&aco, newbuf);

View File

@ -3182,6 +3182,36 @@ vim_regexec_multi(rmp, win, buf, lnum, col)
return r; return r;
} }
#if 0 /* this does not appear to work... */
# ifdef __MINGW32__
# define MINGW_TRY
# endif
#endif
#ifdef MINGW_TRY
/*
* Special assembly code for MingW to simulate __try / __except.
* Does not work with the optimizer!
*/
# include <excpt.h>
static void *ESP_save; /* used as _ESP below */
static void *EBP_save; /* used as _EBP below */
__attribute__ ((cdecl))
EXCEPTION_DISPOSITION
_except_regexec_handler(
struct _EXCEPTION_RECORD *ExceptionRecord,
void *EstablisherFrame,
struct _CONTEXT *ContextRecord,
void *DispatcherContext)
{
__asm__ __volatile__ (
"jmp regexec_reentry");
return 0; /* Function does not return */
}
#endif
/* /*
* Match a regexp against a string ("line" points to the string) or multiple * Match a regexp against a string ("line" points to the string) or multiple
* lines ("line" is NULL, use reg_getline()). * lines ("line" is NULL, use reg_getline()).
@ -3301,6 +3331,17 @@ vim_regexec_both(line, col)
goto theend; goto theend;
} }
#ifdef MINGW_TRY
/* Ugly assembly code that is necessary to simulate "__try". */
__asm__ __volatile__ (
"movl %esp, _ESP_save" "\n\t"
"movl %ebp, _EBP_save");
__asm__ __volatile__ (
"pushl $__except_regexec_handler" "\n\t"
"pushl %fs:0" "\n\t"
"mov %esp, %fs:0");
#endif
#ifdef HAVE_TRY_EXCEPT #ifdef HAVE_TRY_EXCEPT
__try __try
{ {
@ -3426,6 +3467,22 @@ inner_end:
retval = 0L; retval = 0L;
} }
#endif #endif
#ifdef MINGW_TRY
__asm__ __volatile__ (
"jmp regexec_pop" "\n"
"regexec_reentry:" "\n\t"
"movl _ESP_save, %esp" "\n\t"
"movl _EBP_save, %ebp");
EMSG(_(e_complex));
retval = 0L;
__asm__ __volatile__ (
"regexec_pop:" "\n\t"
"mov (%esp), %eax" "\n\t"
"mov %eax, %fs:0" "\n\t"
"add $8, %esp");
#endif
theend: theend:
/* Didn't find a match. */ /* Didn't find a match. */

View File

@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA" #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 26)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 28)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 26, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 28, compiled "