summaryrefslogtreecommitdiff
path: root/lib-src/profile.c
Commit message (Collapse)AuthorAgeFilesLines
* * lib-src/profile.c: Delete long-obsolete fileStefan Monnier2019-04-261-97/+0
| | | | | | | | This auxiliary executable was used by the old `profile.el` which later inspired `elp.el`. It was made obsolete when Emacs acquired native timers. * lib-src/Makefile.in (UTILITIES): Remove profile. (profile${EXEEXT}): Delete rule.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Move current_timespec decl to timespec.hPaul Eggert2018-09-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was motivated by the desire to remove the weird dependency of lib-src/profile.o on src/systime.h. profile.c included systime.h only for current_timespec, and this inclusion required systime.h to have #ifdef emacs in multiple places and complicated further changes I have in mind. The current_timespec decl belongs in timespec.h anyway, and the main effect of this change is to move it there. * lib-src/profile.c (INLINE): Remove. Include timespec.h, not systime.h. * lib/gettime.c (gettime): Prefer clock_gettime to nanotime, and don’t worry about it failing on a CLOCK_REALTIME arg. POSIX requires it to succeed and I don’t know of any counterexamples where the fallbacks would work. (current_timespec): Move here from src/systime.h. Nowadays it seems to be better to not have this function be inline. * lib/timespec.h: Include arg-nonnull.h. (current_timespec): New declaration. (gettime, settime): Declare args to be nonnull. * lib/gettime.c, lib/timespec.h: Copy from Gnulib. * src/systime.h: Simplify by assuming ‘emacs’ is defined, which it always is now. (current_timespec): Move to lib/timespec.h.
* | Adjust to TIMESPEC_HZ renamingPaul Eggert2018-09-101-2/+2
|/ | | | | | | Adjust to lib/timespec.h’s renaming of TIMESPEC_RESOLUTION and LOG10_TIMESPEC_RESOLUTION to TIMESPEC_HZ and LOG10_TIMESPEC_HZ. The old names were misnomers. All uses changed.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Use unlocked stdio more systematicallyPaul Eggert2017-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can improve performance significantly on stdio-bottlenecked code. E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop. * admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io. * lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c: * lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c: * lib-src/profile.c, lib-src/update-game-score.c: Include unlocked-io.h instead of stdio.h, since these programs are single-threaded. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib. * src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c: * src/lread.c, src/term.c: Include sysstdio.h, possibly instead of stdio.h, to define the unlocked functions if the system does not provide them. * src/charset.c, src/lread.c (getc_unlocked): Remove, since sysstdio.h now defines it if needed. * src/cm.c (cmputc, cmcheckmagic): * src/dispnew.c (update_frame, update_frame_with_menu) (update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user): * src/emacs.c (main, Fdump_emacs): * src/fileio.c (Fdo_auto_save, Fset_binary_mode): * src/image.c (slurp_file, png_read_from_file, png_load_body) (our_stdio_fill_input_buffer): * src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt): * src/lread.c (readbyte_from_file): * src/minibuf.c (read_minibuf_noninteractive): * src/print.c (printchar_to_stream, strout) (Fredirect_debugging_output): * src/sysdep.c (reset_sys_modes, procfs_ttyname) (procfs_get_total_memory): * src/term.c (tty_ring_bell, tty_send_additional_strings) (tty_set_terminal_modes, tty_reset_terminal_modes) (tty_update_end, tty_clear_end_of_line, tty_write_glyphs) (tty_write_glyphs_with_face, tty_insert_glyphs) (tty_menu_activate): * src/xfaces.c (Fx_load_color_file): Use unlocked stdio when it should be safe. * src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked) (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked) (putc_unlocked, putchar_unloced): Provide substitutes if not declared.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Port build to gcc -fcheck-pointer-boundsPaul Eggert2016-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This does not let Emacs run, just build. * lib-src/etags.c (main): * lib-src/profile.c (main): Use return, not exit. * src/bytecode.c (BYTE_CODE_THREADED) [__CHKP__]: Do not define, as -fcheck-pointer-bounds is incompatible with taking addresses of labels. * src/menu.c (Fx_popup_dialog): Use eassume, not eassert, to pacify gcc -fcheck-pointer-bounds -Wnull-dereference.
* | Limit <config.h>’s includesPaul Eggert2016-09-301-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on recent problems with the fact that config.h includes stdlib.h etc.; some files need to include stdlib.h later. config.h generally should limit itself to includes that are universally safe; outside of MS-Windows, only stdbool.h makes the cut among the files currently included. So, move the other includes to just the files that need them (Bug#24506). * configure.ac (config_opsysfile): Remove, as this generic hook is no longer needed. * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c: * src/w32proc.c (_GNU_SOURCE): Remove, as it’s OK for config.h to do this now. * src/conf_post.h: Include <ms-w32.h>, instead of the generic config_opsysfile, for simplicity as this old way of configuring is now done only for the MS-Windows port. Do not include <ms-w32.h> if DEFER_MS_W32_H, for the benefit of the few files that want its effects later. Do not include <alloca.h>, <string.h>, or <stdlib.h>. Other files modified to include these headers as needed, or to not include headers that are no longer needed. * src/lisp.h: Include <alloca.h> and <string.h> here, since some of the inline functions need them. * src/regex.c: Include <alloca.h> if not emacs. (If emacs, we can rely on SAFE_ALLOCA.) There is no longer any need to worry about HAVE_ALLOCA_H. * src/unexmacosx.c: Rely on config.h not including stdlib.h. * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H): Define before including <config.h> first, and include <ms-w32.h> after the troublesome headers.
* Rework C source files to avoid ^(Paul Eggert2016-03-101-2/+2
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* A simpler, centralized INLINE.Paul Eggert2013-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/profile.c (INLINE): New macro. (SYSTIME_INLINE): Remove. * src/conf_post.h (INLINE): Define only if not already defined. This allows us to use a single INLINE, defined by one file per executable. * src/emacs.c (INLINE): Define it. Also, include category.h, charset.h, composite.h, dispextern.h, syntax.h, systime.h, so that their INLINE definitions are expanded properly for Emacs. * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE): * src/buffer.h, src/buffer.c (BUFFER_INLINE): * src/category.h, src/category.c (CATEGORY_INLINE): * src/character.h, src/character.c (CHARACTER_INLINE): * src/charset.h, src/charset.c (CHARSET_INLINE): * src/composite.h, src/composite.c (COMPOSITE_INLINE): * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE): * src/frame.h, src/frame.c (FRAME_INLINE): * src/intervals.h, src/intervals.c (INTERVALS_INLINE): * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE): * src/lisp.h, src/alloc.c (LISP_INLINE): * src/process.h, src/process.c (PROCESS_INLINE): * src/syntax.h, src/syntax.c (SYNTAX_INLINE): * src/systime.h, src/sysdep.c (SYSTIME_INLINE): * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE): * src/window.h, src/window.c (WINDOW_INLINE): Remove. All uses replaced with INLINE.
* Simplify EMACS_TIME-related code.Paul Eggert2013-08-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This portability layer is no longer needed, since Emacs has been using struct timespec as a portability layer for some time. Merge from gnulib, incorporating: 2013-08-27 timespec: new convenience constants and function * src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h: Include <time.h> rather than "systime.h"; that's all that's needed now. * src/dispnew.c: Include <timespec.h> rather than "systime.h"; that's all that's needed now. * src/systime.h (EMACS_TIME): Remove. All uses changed to struct timespec. (EMACS_TIME_RESOLUTION): Remove. All uses changed to TIMESPEC_RESOLUTION. (LOG10_EMACS_TIME_RESOLUTION): Remove. All uses changed to LOG10_TIMESPEC_RESOLUTION. (EMACS_SECS, emacs_secs_addr): Remove. All uses changed to tv_sec. (EMACS_NSECS): Remove. All uses changed to tv_nsec. (make_emacs_time): Remove. All used changed to make_timespec. (invalid_timespec): Rename from invalid_emacs_time. All uses changed. (current_timespec): Rename from current_emacs_time. All uses changed. (add_emacs_time): Remove. All uses changed to timespec_add. (sub_emacs_time): Remove. All uses change dot timespec_sub. (EMACS_TIME_SIGN): Remove. All uses changed to timespec_sign. (timespec_valid_p): Rename from EMACS_TIME_VALID_P. All uses changed. (EMACS_TIME_FROM_DOUBLE): Remove. All uses changed to dtotimespec. (EMACS_TIME_TO_DOUBLE): Remove. All uses changed to timespectod. (current_timespec): Rename from current_emacs_time. All uses changed. (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove. All uses changed to timespec_cmp. * src/xgselect.c: Include <timespec.h>, since our .h files don't.
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+2
|
* Use C99-style 'extern inline' if available.Paul Eggert2012-08-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/profile.c (SYSTIME_INLINE): Define. * nt/config.nt: Sync with autogen/config.in. (_GL_INLINE, _GL_EXTERN_INLINE, _GL_INLINE_HEADER_BEGIN) (_GL_INLINE_HEADER_END): New macros. * src/buffer.h (BUFFER_INLINE): * src/category.h (CATEGORY_INLINE): * src/character.h (CHARACTER_INLINE): * src/charset.h (CHARSET_INLINE): * src/composite.h (COMPOSITE_INLINE): * src/dispextern.h (DISPEXTERN_INLINE): * src/lisp.h (LISP_INLINE): * src/systime.h (SYSTIME_INLINE): New macro, replacing 'static inline' in this header. * src/buffer.h, src/category.h, src/character.h, src/charset.h: * src/composite.h, src/dispextern.h, lisp.h, systime.h: Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. * src/alloc.c (LISP_INLINE): * src/buffer.c (BUFFER_INLINE): * src/category.c (CATEGORY_INLINE): * src/character.c (CHARACTER_INLINE): * src/charset.c (CHARSET_INLINE): * src/composite.c (COMPOSITE_INLINE): * src/dispnew.c (DISPEXTERN_INLINE): * src/sysdep.c (SYSTIME_INLINE): Define to EXTERN_INLINE, so that the corresponding functions are compiled into code. * src/conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN) (INLINE_HEADER_END): New macros. * src/lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant, since it's used in non-static inline functions now.
* EMACS_TIME simplification (Bug#11875).Paul Eggert2012-07-101-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces macros (which typically do not work in GDB) with functions, typedefs and enums, making the code easier to debug. The functional style also makes code easier to read and maintain. * lib-src/profile.c (TV2): Remove no-longer-needed static var. * src/systime.h: Include <sys/time.h> on all hosts, not just if WINDOWSNT, since 'struct timeval' is needed in general. (EMACS_TIME): Now a typedef, not a macro. (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants, not macros. (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P) (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ) (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT) (EMACS_TIME_LE): Now functions, not macros. (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS) (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros, which are not functions. All uses rewritten to use: (make_emacs_time): New function. (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME) (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are not functions. All uses rewritten to use the following, respectively: (emacs_secs_addr, invalid_emacs_time, get_emacs_time) (add_emacs_time, sub_emacs_time): New functions. * src/atimer.c: Don't include <sys/time.h>, as "systime.h" does this. * src/fileio.c (Fcopy_file): * src/xterm.c (XTflash): Get the current time closer to when it's used. * src/makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
* Adapt the MS-DOS build to the latest changes.Eli Zaretskii2012-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not bootstrap-clean (which doesn't exist). msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu". msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command. msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty. Remove lines that invoke PAXCTL. (clean): Fix recipe not to run Unixy shell commands. msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'. (HAVE_STRNCASECMP): Edit to 1. msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty. (C_SWITCH_SYSTEM): Add "-I../msdos". msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT) (GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H) (HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H) (NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H) (NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT) (REPLACE_STRUCT_TIMEVAL): Edit to appropriate values. (BUILT_SOURCES): Edit out sys/select.h and sys/time.h. (mostlyclean-local, distclean-generic): Fix recipe not to run Unixy shell commands. src/sysselect.h [DOS_NT]: Don't include sys/select.h. src/s/ms-w32.h (select, pselect): Don't define here, they are defined in sysselect.h src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select. src/sysdep.c: Don't include dos.h and dosfns.h. src/process.c (sys_select): src/msdos.c (sys_select): Accept one more argument and ignore it. src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime; adapt data types and code to that. src/dosfns.c: src/msdos.c (gettime, settime): Define away the prototypes in dos.h, which clashes with the gnulib function of the same name. lisp/emacs-lisp/timer.el (timer-until): Subtract results of float-time, instead of taking float-time of the result of time-subtract, since float-time signals an error for negative time arguments.
* Support higher-resolution time stamps.Paul Eggert2012-06-221-20/+12
| | | | Fixes: debbugs:9000
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Declare file-scope functions and variables static if not exported.Paul Eggert2011-02-211-2/+2
| | | | | | | | This is more consistent, and is nicer with gcc -Wstrict-prototypes. * ebrowse.c, emacsclient.c, fakemail.c, make-docfile.c, movemail.c: * profile.c, test-distrib.c, update-game-score.c: Declare non-'main' functions and variables to be static. * ebrowse.c: Omit redundant function prototypes.
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* Nuke arch-tags.Glenn Morris2011-01-151-2/+0
|
* Merge from emacs-23Stefan Monnier2011-01-141-1/+1
|\
| * Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
| |
* | Convert function definitions to standard C.Dan Nicolaescu2010-07-021-3/+3
|/ | | | | | | | | | | | | | | * lib-src/update-game-score.c: Convert function definitions to standard C. * lib-src/sorted-doc.c: * lib-src/profile.c: * lib-src/pop.c: * lib-src/movemail.c: * lib-src/make-docfile.c: * lib-src/hexl.c: * lib-src/fakemail.c: * lib-src/etags.c: * lib-src/ebrowse.c: * lib-src/digest-doc.c: * lib-src/b2m.c: Likewise.
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* Add 2009 to copyright years.Glenn Morris2009-01-081-1/+1
|
* Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-091-9/+7
|
* Add 2008 to copyright years.Glenn Morris2008-01-071-1/+1
|
* Switch license to GPLv3 or later.Glenn Morris2007-07-251-1/+1
|
* Update copyright for years from Emacs 21 to present (mainly addingGlenn Morris2007-01-161-2/+2
| | | | 2001).
* Update years in copyright notice; nfc.Thien-Thi Nguyen2006-02-061-1/+1
|
* Update years in copyright notice; nfc.Thien-Thi Nguyen2005-08-071-1/+2
|
* Update FSF's address.Lute Kamstra2005-07-041-2/+2
|
* Throughout, replace 0 destined for `exit' arg with `EXIT_SUCCESS'.Thien-Thi Nguyen2004-05-081-3/+5
| | | | | Likewise, replace 1 with `EXIT_FAILURE'. (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
* Add arch taglinesMiles Bader2003-09-011-0/+3
|
* Trailing whitespace deleted.Juanma Barranquero2003-02-041-1/+1
|
* Remove unnecessary whitespaces.Pavel Janík2001-12-301-3/+3
|
* Include config.h, not ../src/config.h and systime.h, not ../src/systime.h.Pavel Janík2001-10-081-2/+2
|
* Add support for large files. Merge glibc 2.1.2.Paul Eggert1999-10-191-2/+2
| | | | | | | | | | | | | | | | | | * b2m.c, emacsclient.c, emacsserver.c, fakemail.c, make-docfile.c, movemail.c, pop.c: Do not include <stdlib.h>, as <config.h> does this now. * b2m.c, emacsserver.c, etags.c, profile.c: Include <config.h> before any system include files. * emacsclient.c, emacsserver.c, fakemail.c, movemail.c, pop.c, test-distrib.c: (read, write, open, close): Do not undef. * getopt.c, getopt1.c: Adopt glibc 2.1.2, with the following fix: (const): Do not define if HAVE_CONFIG_H; that's config.h's job. * getopt.h: Adopt glibc 2.1.2.
* (get_time): Cast arg to fprintf.Richard M. Stallman1997-08-131-1/+1
|
* Declare main as int, not void.Karl Heuer1996-07-151-1/+1
|
* Update FSF's address in the preamble.Erik Naggum1996-01-151-12/+13
|
* (gettimeofday): New function, defined if necessary.Richard M. Stallman1995-07-301-0/+17
|
* (get_time): Fix up whitespace.Richard M. Stallman1994-11-281-1/+1
|