diff options
| author | Stefan Monnier | 2006-03-09 23:06:58 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-03-09 23:06:58 +0000 |
| commit | 349a450079672dcf0cb5bffb40feb388fa6879c9 (patch) | |
| tree | 3a27191803a7ae6783e1f72796c9a035dc866e10 /src | |
| parent | 3f9c65caa44929c85caa57e1470667f1730a0f45 (diff) | |
| download | emacs-349a450079672dcf0cb5bffb40feb388fa6879c9.tar.gz emacs-349a450079672dcf0cb5bffb40feb388fa6879c9.zip | |
(USE_POSIX_MEMALIGN): New macro.
(ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 22 | ||||
| -rw-r--r-- | src/alloc.c | 10 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6cf09be70fd..0a9d21b0c9b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2006-03-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * alloc.c (USE_POSIX_MEMALIGN): New macro. | ||
| 4 | (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it. | ||
| 5 | |||
| 1 | 2006-03-09 Kenichi Handa <handa@m17n.org> | 6 | 2006-03-09 Kenichi Handa <handa@m17n.org> |
| 2 | 7 | ||
| 3 | * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding | 8 | * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding |
| @@ -28,10 +33,10 @@ | |||
| 28 | (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines. | 33 | (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines. |
| 29 | 34 | ||
| 30 | * macfns.c (x_default_scroll_bar_color_parameter) | 35 | * macfns.c (x_default_scroll_bar_color_parameter) |
| 31 | (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Remove | 36 | (x_set_scroll_bar_foreground, x_set_scroll_bar_background): |
| 32 | unnecessary prototypes. | 37 | Remove unnecessary prototypes. |
| 33 | (x_set_scroll_bar_default_width): Use | 38 | (x_set_scroll_bar_default_width): |
| 34 | MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH. | 39 | Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH. |
| 35 | (mac_set_scroll_bar_width): New function. | 40 | (mac_set_scroll_bar_width): New function. |
| 36 | (mac_frame_parm_handlers): Set it as handler for scroll-bar-width. | 41 | (mac_frame_parm_handlers): Set it as handler for scroll-bar-width. |
| 37 | 42 | ||
| @@ -57,9 +62,9 @@ | |||
| 57 | lines, by distributing the rows evenly over the tool-bar screen area. | 62 | lines, by distributing the rows evenly over the tool-bar screen area. |
| 58 | (Vtool_bar_border): New variable. | 63 | (Vtool_bar_border): New variable. |
| 59 | (syms_of_xdisp): DEFVAR_LISP it. | 64 | (syms_of_xdisp): DEFVAR_LISP it. |
| 60 | (display_tool_bar_line): Add HEIGHT arg for desired row height. Make | 65 | (display_tool_bar_line): Add HEIGHT arg for desired row height. |
| 61 | tool-bar row the desired height. Use default face for border below | 66 | Make tool-bar row the desired height. Use default face for border |
| 62 | tool-bar. | 67 | below tool-bar. |
| 63 | (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of | 68 | (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of |
| 64 | actual tool-bar rows. | 69 | actual tool-bar rows. |
| 65 | (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially. | 70 | (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially. |
| @@ -86,8 +91,7 @@ | |||
| 86 | 91 | ||
| 87 | 2006-02-26 Chong Yidong <cyd@stupidchicken.com> | 92 | 2006-02-26 Chong Yidong <cyd@stupidchicken.com> |
| 88 | 93 | ||
| 89 | * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary | 94 | * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument. |
| 90 | argument. | ||
| 91 | 95 | ||
| 92 | * xterm.c: (x_load_font, x_term_init, XTmouse_position) | 96 | * xterm.c: (x_load_font, x_term_init, XTmouse_position) |
| 93 | (handle_one_xevent, x_connection_closed, x_list_fonts): No arg for | 97 | (handle_one_xevent, x_connection_closed, x_list_fonts): No arg for |
diff --git a/src/alloc.c b/src/alloc.c index bb5f550d175..ee84bd2fb29 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -883,6 +883,10 @@ lisp_free (block) | |||
| 883 | /* The entry point is lisp_align_malloc which returns blocks of at most */ | 883 | /* The entry point is lisp_align_malloc which returns blocks of at most */ |
| 884 | /* BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ | 884 | /* BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ |
| 885 | 885 | ||
| 886 | /* Use posix_memalloc if the system has it and we're using the system's | ||
| 887 | malloc (because our gmalloc.c routines don't have posix_memalign although | ||
| 888 | its memalloc could be used). */ | ||
| 889 | #define USE_POSIX_MEMALIGN (HAVE_POSIX_MEMALIGN && SYSTEM_MALLOC) | ||
| 886 | 890 | ||
| 887 | /* BLOCK_ALIGN has to be a power of 2. */ | 891 | /* BLOCK_ALIGN has to be a power of 2. */ |
| 888 | #define BLOCK_ALIGN (1 << 10) | 892 | #define BLOCK_ALIGN (1 << 10) |
| @@ -948,7 +952,7 @@ struct ablocks | |||
| 948 | #define ABLOCKS_BUSY(abase) ((abase)->blocks[0].abase) | 952 | #define ABLOCKS_BUSY(abase) ((abase)->blocks[0].abase) |
| 949 | 953 | ||
| 950 | /* Pointer to the (not necessarily aligned) malloc block. */ | 954 | /* Pointer to the (not necessarily aligned) malloc block. */ |
| 951 | #ifdef HAVE_POSIX_MEMALIGN | 955 | #ifdef USE_POSIX_MEMALIGN |
| 952 | #define ABLOCKS_BASE(abase) (abase) | 956 | #define ABLOCKS_BASE(abase) (abase) |
| 953 | #else | 957 | #else |
| 954 | #define ABLOCKS_BASE(abase) \ | 958 | #define ABLOCKS_BASE(abase) \ |
| @@ -989,7 +993,7 @@ lisp_align_malloc (nbytes, type) | |||
| 989 | mallopt (M_MMAP_MAX, 0); | 993 | mallopt (M_MMAP_MAX, 0); |
| 990 | #endif | 994 | #endif |
| 991 | 995 | ||
| 992 | #ifdef HAVE_POSIX_MEMALIGN | 996 | #ifdef USE_POSIX_MEMALIGN |
| 993 | { | 997 | { |
| 994 | int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); | 998 | int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); |
| 995 | if (err) | 999 | if (err) |
| @@ -1105,7 +1109,7 @@ lisp_align_free (block) | |||
| 1105 | } | 1109 | } |
| 1106 | eassert ((aligned & 1) == aligned); | 1110 | eassert ((aligned & 1) == aligned); |
| 1107 | eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1)); | 1111 | eassert (i == (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1)); |
| 1108 | #ifdef HAVE_POSIX_MEMALIGN | 1112 | #ifdef USE_POSIX_MEMALIGN |
| 1109 | eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0); | 1113 | eassert ((unsigned long)ABLOCKS_BASE (abase) % BLOCK_ALIGN == 0); |
| 1110 | #endif | 1114 | #endif |
| 1111 | free (ABLOCKS_BASE (abase)); | 1115 | free (ABLOCKS_BASE (abase)); |