Attached are a couple of low priority patches. In netbeans.c, there are 2 format mismatches (%d instead of %ld):
- fixed-format-netbeans.c.patch In nbdebug.c, I see 2 functions [nbtrace() & nbprt()] which are defined but which are never called from anywhere (are they needed?): - fixed-deadcode-nbdebug.c.patch When compiled with -DEXITFREE, Vim is meant to free all blocks before exiting. Following patches frees a few memory blocks which were not being freed before exiting. Freeing them helps to remove false alerts when trying to search for real memory leaks. - fixed-exitfree-search.c.patch Fixes memory not freed when doing: :rightleft :/foobar :q! - fixed-exitfree-tag.c.patch Fixes memory not freed when doing: :pts foo :q! - fixed-exitfree-misc2.c.patch Fixes memory not free when doing :set keymap=esperanto " or any other keymap... :q! - fixed-exitfree-ex_docmd.c.patch - fixed-exitfree-gui_gtk_x11.c.patch Regards -- Dominique --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
Index: tag.c =================================================================== RCS file: /cvsroot/vim/vim7/src/tag.c,v retrieving revision 1.46 diff -c -r1.46 tag.c *** tag.c 13 Jan 2009 16:28:08 -0000 1.46 --- tag.c 7 Feb 2009 09:52:12 -0000 *************** *** 2542,2547 **** --- 2542,2556 ---- { ga_clear_strings(&tag_fnames); do_tag(NULL, DT_FREE, 0, 0, 0); + tag_freematch(); + + # if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) + if (ptag_entry.tagname) + { + vim_free(ptag_entry.tagname); + ptag_entry.tagname = NULL; + } + # endif } #endif
Index: ex_docmd.c =================================================================== RCS file: /cvsroot/vim/vim7/src/ex_docmd.c,v retrieving revision 1.164 diff -c -r1.164 ex_docmd.c *** ex_docmd.c 28 Jan 2009 14:42:40 -0000 1.164 --- ex_docmd.c 7 Feb 2009 09:48:19 -0000 *************** *** 7846,7851 **** --- 7846,7854 ---- { vim_free(prev_dir); prev_dir = NULL; + + vim_free(globaldir); + globaldir = NULL; } #endif
Index: search.c =================================================================== RCS file: /cvsroot/vim/vim7/src/search.c,v retrieving revision 1.68 diff -c -r1.68 search.c *** search.c 18 Jul 2008 10:05:58 -0000 1.68 --- search.c 7 Feb 2009 09:46:30 -0000 *************** *** 345,350 **** --- 345,359 ---- { vim_free(spats[0].pat); vim_free(spats[1].pat); + + # ifdef FEAT_RIGHTLEFT + if (mr_pattern_alloced) + { + vim_free(mr_pattern); + mr_pattern_alloced = FALSE; + mr_pattern = NULL; + } + # endif } #endif
Index: misc2.c =================================================================== RCS file: /cvsroot/vim/vim7/src/misc2.c,v retrieving revision 1.78 diff -c -r1.78 misc2.c *** misc2.c 22 Jan 2009 20:32:04 -0000 1.78 --- misc2.c 7 Feb 2009 09:47:31 -0000 *************** *** 1010,1015 **** --- 1010,1018 ---- # if defined(FEAT_PROFILE) do_cmdline_cmd((char_u *)"profdel *"); # endif + # if defined(FEAT_KEYMAP) + do_cmdline_cmd((char_u *)"set keymap="); + #endif # ifdef FEAT_TITLE free_titles();
Index: gui_gtk_x11.c =================================================================== RCS file: /cvsroot/vim/vim7/src/gui_gtk_x11.c,v retrieving revision 1.61 diff -c -r1.61 gui_gtk_x11.c *** gui_gtk_x11.c 28 Nov 2008 20:28:56 -0000 1.61 --- gui_gtk_x11.c 7 Feb 2009 09:49:02 -0000 *************** *** 412,417 **** --- 412,418 ---- #endif #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) static const char *restart_command = NULL; + static char *abs_restart_command = NULL; #endif static int found_iconic_arg = FALSE; *************** *** 449,456 **** char_u buf[MAXPATHL]; if (mch_FullName((char_u *)argv[0], buf, (int)sizeof(buf), TRUE) == OK) ! /* Tiny leak; doesn't matter, and usually we don't even get here */ ! restart_command = (char *)vim_strsave(buf); } #endif --- 450,456 ---- char_u buf[MAXPATHL]; if (mch_FullName((char_u *)argv[0], buf, (int)sizeof(buf), TRUE) == OK) ! abs_restart_command = (char *)vim_strsave(buf); } #endif *************** *** 611,616 **** --- 611,619 ---- gui_mch_free_all() { vim_free(gui_argv); + #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) + vim_free(abs_restart_command); + #endif } #endif *************** *** 1678,1684 **** offshoot = dx > dy ? dx : dy; ! /* Make a linearly declaying timer delay with a threshold of 5 at a * distance of 127 pixels from the main window. * * One could think endlessly about the most ergonomic variant here. --- 1681,1687 ---- offshoot = dx > dy ? dx : dy; ! /* Make a linearly decaying timer delay with a threshold of 5 at a * distance of 127 pixels from the main window. * * One could think endlessly about the most ergonomic variant here. *************** *** 2314,2320 **** * Also pass the window role to give the WM something to match on. * The role is set in gui_mch_open(), thus should _never_ be NULL. */ i = 0; ! argv[i++] = restart_command; argv[i++] = "-f"; argv[i++] = "-g"; # ifdef HAVE_GTK2 --- 2317,2323 ---- * Also pass the window role to give the WM something to match on. * The role is set in gui_mch_open(), thus should _never_ be NULL. */ i = 0; ! argv[i++] = abs_restart_command ? abs_restart_command : restart_command; argv[i++] = "-f"; argv[i++] = "-g"; # ifdef HAVE_GTK2 *************** *** 2964,2970 **** /* At start-up, don't try to set the hints until the initial * values have been used (those that dictate our initial size) ! * Let forced (i.e., correct) values thruogh always. */ if (!(force_width && force_height) && init_window_hints_state > 0) { --- 2967,2973 ---- /* At start-up, don't try to set the hints until the initial * values have been used (those that dictate our initial size) ! * Let forced (i.e., correct) values through always. */ if (!(force_width && force_height) && init_window_hints_state > 0) { *************** *** 3784,3790 **** #endif if (gtk_socket_id != 0) ! /* make sure keybord input can go to the drawarea */ GTK_WIDGET_SET_FLAGS(gui.drawarea, GTK_CAN_FOCUS); /* --- 3787,3793 ---- #endif if (gtk_socket_id != 0) ! /* make sure keyboard input can go to the drawarea */ GTK_WIDGET_SET_FLAGS(gui.drawarea, GTK_CAN_FOCUS); /* *************** *** 4863,4869 **** styled_font[1] = &gui.ital_font; styled_font[2] = &gui.boldital_font; ! /* First free whatever was freviously there. */ for (i = 0; i < 3; ++i) if (*styled_font[i]) { --- 4866,4872 ---- styled_font[1] = &gui.ital_font; styled_font[2] = &gui.boldital_font; ! /* First free whatever was previously there. */ for (i = 0; i < 3; ++i) if (*styled_font[i]) {
Index: nbdebug.c =================================================================== RCS file: /cvsroot/vim/vim7/src/nbdebug.c,v retrieving revision 1.4 diff -c -r1.4 nbdebug.c *** nbdebug.c 24 Jun 2008 21:54:30 -0000 1.4 --- nbdebug.c 7 Feb 2009 09:44:53 -0000 *************** *** 33,39 **** u_int nb_dlevel = 0; /* nb_debug verbosity level */ void nbdb(char *, ...); ! void nbtrace(char *, ...); static int lookup(char *); #ifdef USE_NB_ERRORHANDLER --- 33,41 ---- u_int nb_dlevel = 0; /* nb_debug verbosity level */ void nbdb(char *, ...); ! #if 0 ! void nbtrace(char *, ...); ! #endif static int lookup(char *); #ifdef USE_NB_ERRORHANDLER *************** *** 101,107 **** ! void nbtrace( char *fmt, --- 103,109 ---- ! #if 0 void nbtrace( char *fmt, *************** *** 117,122 **** --- 119,125 ---- } } /* end nbtrace */ + #endif void *************** *** 135,141 **** } /* end nbdbg */ ! void nbprt( char *fmt, --- 138,144 ---- } /* end nbdbg */ ! #if 0 void nbprt( char *fmt, *************** *** 151,156 **** --- 154,160 ---- } } /* end nbprt */ + #endif static int
Index: netbeans.c =================================================================== RCS file: /cvsroot/vim/vim7/src/netbeans.c,v retrieving revision 1.37 diff -c -r1.37 netbeans.c *** netbeans.c 6 Jan 2009 15:13:56 -0000 1.37 --- netbeans.c 7 Feb 2009 09:42:59 -0000 *************** *** 2318,2324 **** } if (pos) { ! coloncmd(":sign place %d line=%d name=%d buffer=%d", serNum, pos->lnum, typeNum, buf->bufp->b_fnum); if (typeNum == curPCtype) coloncmd(":sign jump %d buffer=%d", serNum, --- 2318,2324 ---- } if (pos) { ! coloncmd(":sign place %d line=%ld name=%d buffer=%d", serNum, pos->lnum, typeNum, buf->bufp->b_fnum); if (typeNum == curPCtype) coloncmd(":sign jump %d buffer=%d", serNum, *************** *** 2422,2428 **** GUARDED) == 0) { coloncmd( ! ":sign place %d line=%d name=%d buffer=%d", guardId++, lnum, GUARDED, buf->bufp->b_fnum); } --- 2422,2428 ---- GUARDED) == 0) { coloncmd( ! ":sign place %d line=%ld name=%d buffer=%d", guardId++, lnum, GUARDED, buf->bufp->b_fnum); }