1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 01:41:01 -08:00
Commit graph

34923 commits

Author SHA1 Message Date
Eli Zaretskii
dbe17fefcc Enable thread support in the MS-Windows build.
src/systhread.h (w32thread_critsect, w32thread_cond_t, sys_mutex_t)
 (sys_cond_t, sys_thread_t) [WINDOWSNT]: New data types.
 src/systhread.c (sys_mutex_init, sys_mutex_lock, sys_mutex_unlock)
 (sys_mutex_destroy, sys_cond_init, sys_cond_wait)
 (sys_cond_signal, sys_cond_broadcast, sys_cond_destroy)
 (sys_thread_self, sys_thread_equal, w32_beginthread_wrapper)
 (sys_thread_create, sys_thread_yield) [WINDOWSNT]: New functions.

 configure.ac (THREADS_ENABLED): Enable threads for MinGW, even
 if pthreads is not available.
2013-08-30 17:19:16 +03:00
Tom Tromey
8c46d17826 rename thread-blocker to thread--blocker 2013-08-27 12:57:18 -06:00
Tom Tromey
07efb14034 remove binding_symbol 2013-08-27 12:54:38 -06:00
Tom Tromey
c44fedc603 fix style of threadp, mutexp, and condition-variable-p 2013-08-27 12:33:04 -06:00
Tom Tromey
6a64a7118d make thread_check_current_buffer return bool 2013-08-27 12:29:56 -06:00
Tom Tromey
5b05b5a6bc add a comment before flush_stack_call_func 2013-08-27 12:29:05 -06:00
Tom Tromey
545af8557a fix whitespace_regexp warning 2013-08-26 20:09:38 -06:00
Eli Zaretskii
6e9fb70cdf Fix MS-Windows build.
src/callproc.c: 
 src/emacs.c: 
 src/filelock.c: 
 src/process.c: 
 src/sysdep.c: 
 src/w32.c: Reshuffle Windows-specific headers to avoid errors with
 redefinition of fd_set etc.
 src/process.c: Don't use num_pending_connects when
 NON_BLOCKING_CONNECT is not defined.
 src/sysselect.h: Move definitions of FD_* macros and of SELECT_TYPE
 here from w32.h.
 src/w32proc.c (sys_select): Adjust the argument types to what
 thread.h expects.

 nt/inc/sys/socket.h: Include stdint.h.  Include sysselect.h instead
 of w32.h.
2013-08-26 21:42:11 +03:00
Tom Tromey
c160274456 use record_unwind_protect_void, avoid warning 2013-08-26 08:53:26 -06:00
Tom Tromey
2ee7755c8d implement --enable-threads and a thread-less mode 2013-08-26 08:46:30 -06:00
Tom Tromey
793ea5055a merge from trunk 2013-08-25 14:25:59 -06:00
Eli Zaretskii
6dc695d1e3 Add commentary for the last commit. 2013-08-24 18:21:05 +03:00
Eli Zaretskii
11f20add70 Fix bug #15175 with cursor on boxed characters from display tables.
src/xdisp.c (get_next_display_element): Don't apply to characters
 from a display vector the logic of setting it->end_of_box_run_p
 suitable for characters from a buffer.
2013-08-24 15:59:13 +03:00
Eli Zaretskii
b34454d067 Fix bug #15176 with setting directory times on MS-Windows.
src/w32.c (fdutimens): Call 'utime', which is implemented on w32.c
 to handle directories, rather than '_utime' which doesn't.
2013-08-24 13:15:01 +03:00
Jan Djärv
6e1b469ee2 * gtkutil.c (x_wm_set_size_hint): Don't set hints when maximized
or fullscreen.

Fixes: debbugs:14627
2013-08-24 10:43:36 +02:00
Paul Eggert
9c05bccfb9 System-dependent integer overflow fixes.
* process.c (Fset_process_window_size): Signal an error if
the window size is outside the range supported by the lower level.
* sysdep.c (set_window_size): Return negative on error,
nonnegative on success, rather than -1, 0, 1 on not in system,
failure, success.  This is simpler.  Caller changed.
(serial_configure): Remove unnecessary initialization of local.
(procfs_get_total_memory) [GNU_LINUX]: Don't assume system memory
size fits in unsigned long; this isn't true on some 32-bit hosts.
Avoid buffer overrun if some future version of /proc/meminfo has a
variable name longer than 20 bytes.
(system_process_attributes) [__FreeBSD__]:
Don't assume hw.availpages fits in 'int'.
2013-08-23 19:23:34 -07:00
Paul Eggert
c365c35580 Don't let very long directory names overrun the stack.
Fix some related minor problems involving "//", vfork.
* callproc.c (encode_current_directory): New function.
(call_process): Don't append "/"; not needed.
* fileio.c (file_name_as_directory_slop): New constant.
(file_name_as_directory): Allow SRC to be longer than SRCLEN;
this can save the caller having to alloca.
(Ffile_name_as_directory, Fdirectory_file_name, Fexpand_file_name):
Use SAFE_ALLOCA, not alloca.
(directory_file_name, Fexpand_file_name): Leave leading "//"
alone, since it can be special even on POSIX platforms.
* callproc.c (call_process):
* process.c (Fformat_network_address):
* sysdep.c (sys_subshell):
Use encode_current_directory rather than rolling our own.
(create_process): No need to encode directory; caller does that now.
* process.h (encode_current_directory): New decl.
* sysdep.c (sys_subshell): Work even if vfork trashes saved_handlers.
Rework to avoid 'goto xyzzy;'.
2013-08-23 10:57:07 -07:00
Eli Zaretskii
6c6014d4cc Fix bug #15155 with ignoring face remapping for strings from prefix properties.
src/xdisp.c (handle_face_prop): If the default face was remapped use
 the remapped face for strings from prefix properties.
2013-08-23 17:25:39 +03:00
Dmitry Antipov
6b729d1685 * window.c (struct save_window_data): Fix typo. 2013-08-23 08:17:04 +04:00
Dmitry Antipov
9997ec56be Minor cleanup for redisplay interface and few related functions.
* frame.h (enum text_cursor_kinds): Move from here...
* dispextern.h (enum text_cursor_kinds): ...to here.
(toplevel): Drop unnecessary declarations.
(struct redisplay_interface): Use bool and enum text_cursor_kinds
in update_window_end_hook and draw_window_cursor functions.
(display_and_set_cursor, x_update_cursor): Adjust prototypes.
* nsterm.m (ns_update_window_end, ns_draw_window_cursor):
* w32term.c (x_update_window_end,w32_draw_window_cursor):
* xterm.c (x_update_window_end, x_draw_window_cursor):
* xdisp.c (display_and_set_cursor, update_window_cursor)
(update_cursor_in_window_tree, x_update_cursor): Use bool and
enum text_cursor_kinds where appropriate.
2013-08-23 08:03:25 +04:00
Dmitry Antipov
7f780da621 Redesign redisplay interface to drop updated_row and updated_area.
* dispextern.h (updated_row, updated_area): Remove declaration.
(struct redisplay_interface): Pass glyph row and row area parameters
to write_glyphs, insert_glyphs and clear_end_of_line functions.
(x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
Adjust prototypes.
* dispnew.c (updated_row, updated_area): Remove.
(redraw_overlapped_rows, update_window_line): Adjust user.
(update_marginal_area, update_text_area): Likewise.  Pass updated row
as a parameter.  Prefer enum glyph_row_area to int where appropriate.
* xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
Adjust users.
2013-08-23 07:03:37 +04:00
Paul Eggert
2649579468 * process.c (flush_pending_output): Remove stub.
All uses removed.
2013-08-22 11:29:51 -07:00
Paul Eggert
4a88129ae4 * callproc.c: Fix race that killed background processes.
(call_process): New arg TEMPFILE_INDEX.  Callers changed.
Record deleted process-id in critical section, not afterwards.
Don't mistakenly kill process created by a call-process invocation
that discards output and does not wait.

Fixes: debbugs:15144
2013-08-21 14:27:30 -07:00
Dmitry Antipov
0c5307b05f Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE
and GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES.
* alloc.c (toplevel): Remove unnecessary nested #if...#endif.
(mark_maybe_object) [!GC_MARK_STACK]: Define to emacs_abort
to shut up compiler in mark_object.
(dump_zombies): Convert to global and add EXTERNALLY_VISIBLE.
2013-08-21 11:02:45 +04:00
Paul Eggert
0d7c1e66ff * process.c (allocate_pty) [PTY_OPEN]: Set fd's FD_CLOEXEC flag.
We can't portably rely on PTY_OPEN doing that, even if
it calls posix_openpt with O_CLOEXEC.
2013-08-20 22:39:51 -07:00
Kenichi Handa
3f246b6572 src/character.c (string_char): Improve commentary. 2013-08-20 17:56:03 +03:00
Tom Tromey
1ce4c6398e fix up some merge errors in process.c
remove a dead function
clean up a fixme I added in create_pty during the merge
2013-08-19 22:13:47 -06:00
Tom Tromey
6d75555c5c merge from trunk 2013-08-19 21:53:07 -06:00
Paul Eggert
8c2f38aaab * image.c (SIGNATURE_DIGESTSIZE): Remove.
(struct animation_cache): Make signature a flexible array member.
All uses changed.  This is a tad slower but may insulate us better
from future changes to ImageMagick.
2013-08-19 17:51:35 -07:00
Paul Eggert
bb566ceafe * image.c: Shrink memory needed for animation cache.
(SIGNATURE_DIGESTSIZE): New constant.
(struct animation_cache): Make 'signature' a fixed size array of bytes.
(imagemagick_create_cache): Copy the signature.  This saves
several KB of memory that ImageMagick wastes per signature.
Don't bother updating the update_time, as the caller does that now.
(imagemagick_prune_animation_cache): Don't destroy the signature, as
it's a fixed size struct member now.
(imagemagick_get_animation_cache): Always destroy the signature,
as it's now imagemagick_create_cache's responsibility to copy it.
Avoid duplicate calls to strcmp and to imagemagick_create_cache,
and use memcmp rather than strcmp.
eassert that ImageMagick returns a signature of the specified length.
2013-08-19 13:47:27 -07:00
Lars Magne Ingebrigtsen
453f40228f (imagemagick_get_animation_cache): Fix memory leak. 2013-08-19 19:56:58 +02:00
Paul Eggert
824a2fa737 * image.c: Space before paren. 2013-08-19 09:24:06 -07:00
Lars Magne Ingebrigtsen
2a42bbcee8 Fix previous commit.
(imagemagick_get_animation_cache): Revert to previous definition
so that it actually works.  But keep the memory leak fix.
2013-08-19 17:14:42 +02:00
Lars Magne Ingebrigtsen
6da2692802 * image.c (imagemagick_get_animation_cache): Don't segfault on each invocation.
Bug introduced by 2013-08-19T07:01:37Z!eggert@cs.ucla.edu, which obviously hadn't even been
tested once.
2013-08-19 16:52:52 +02:00
Paul Eggert
d0139df5b6 * image.c: Fix animation cache signature memory leak.
Fix some other minor performance problems while we're at it.
(imagemagick_create_cache): Clear just the members that
need clearing.  Don't set update_time, as caller does that now.
(imagemagick_prune_animation_cache, imagemagick_get_animation_cache):
Simplify by using pointer-to-pointer instead of a prev pointer.
(imagemagick_prune_animation_cache): Use make_emacs_time rather
than EMACS_TIME_FROM_DOUBLE, and DestroyString rather than free.
(imagemagick_get_animation_cache): Don't xstrdup the image signature;
it's already a copy.  Free the signature probe unless it's cached.
2013-08-19 00:01:37 -07:00
Paul Eggert
2249012558 * process.c (handle_child_signal): Fix crash; deleted pid.
This was introduced by my 2013-08-12 fix for Bug#15035.

Fixes: debbugs:15106
2013-08-18 22:46:17 -07:00
Dmitry Antipov
deb31e75f8 * image.c (imagemagick_create_cache, imagemagick_get_animation_cache)
(imagemagick_prune_animation_cache): Now static.
2013-08-19 08:24:19 +04:00
Lars Magne Ingebrigtsen
319a4d0389 * image.c (imagemagick_get_animation_cache): Don't segfault when
pruning all entries.
2013-08-18 21:18:43 +02:00
Ken Brown
f747d82e08 Change size of static heap on Cygwin; report maximum usage after dumping.
* src/sheap.c (STATIC_HEAP_SIZE): Adjust to current needs; use bigger
static heap if ENABLE_CHECKING is defined.
(max_bss_sbrk_ptr): New variable.
(bss_sbrk): Use it.
(report_sheap_usage): Report maximum static heap usage instead of
ending static heap usage.
2013-08-18 13:37:31 -04:00
Eli Zaretskii
d2c28fab13 Fix a minor issue with loading zlib DLL on MS-Windows.
src/decompress.c (Fzlib_available_p) [WINDOWSNT]: Update the value
 of zlib_initialized according to the results of calling
 init_zlib_functions.
2013-08-17 20:18:07 +03:00
Xue Fuqiao
70ff8240e4 Another doc fix for `buffer-undo-list'. 2013-08-17 06:32:24 +08:00
Lars Magne Ingebrigtsen
49ceb676b0 (imagemagick_load_image): Remove the ping_wand code
The apparently only saved time on invalid animated images, and slowed
down everything else.  Optimise for the common case.
2013-08-16 17:31:04 +02:00
Lars Magne Ingebrigtsen
6146bf5d2f image.c: Fix debugging code accidentally checked in 2013-08-16 17:13:42 +02:00
Lars Magne Ingebrigtsen
8a6f875f7e (imagemagick_get_animation_cache): Fix a double-free error. 2013-08-16 17:10:13 +02:00
Lars Magne Ingebrigtsen
274ff63f7f * image.c: Implement an ImageMagick per-image cache. 2013-08-16 16:54:46 +02:00
Paul Eggert
526e5233cc Spelling fixes. 2013-08-15 22:15:51 -07:00
Xue Fuqiao
de179a3e1e * src/editfns.c (insert_before_markers): Mention overlay in the doc string. 2013-08-16 10:09:08 +08:00
Xue Fuqiao
2bede2ed96 Remove documentation of undefined behavior.
* doc/lispref/positions.texi (Character Motion):
* doc/lispref/markers.texi (Moving Markers):
(Creating Markers): Comment out undefined behavior.

* src/marker.c (set_marker): Remove documentation of undefined behavior.
2013-08-16 08:20:56 +08:00
Lars Magne Ingebrigtsen
0f8a692622 Add comment. 2013-08-15 22:17:35 +02:00
Lars Magne Ingebrigtsen
1eade94342 Whitespace fixup. 2013-08-15 22:10:47 +02:00