From: Paul Eggert <eggert@cs.ucla.edu>
To: rms@gnu.org
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
Date: Tue, 31 Jul 2012 16:28:18 -0700 [thread overview]
Message-ID: <50186A12.9080302@cs.ucla.edu> (raw)
In-Reply-To: <E1SwKyo-0000UN-1h@fencepost.gnu.org>
On 07/31/2012 03:31 PM, Richard Stallman wrote:
> When the initializer is long and in braces, it's ok to break
> after the = sign and put the open brace in column zero,
> because that makes the whole initializer a defun.
OK, that blesses some of the use of trailing '=' in lines,
but there are still lots of places where the style
guideline isn't being followed now. Would it be a good idea
to change this systematically, with patches like the following?
(This patch is just a sample: it covers just src/alloc.c.)
=== modified file 'src/alloc.c'
*** src/alloc.c 2012-07-31 12:36:19 +0000
--- src/alloc.c 2012-07-31 23:22:42 +0000
***************
*** 537,552 ****
- XMALLOC_OVERRUN_CHECK_SIZE)
static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] =
! { '\x9a', '\x9b', '\xae', '\xaf',
! '\xbf', '\xbe', '\xce', '\xcf',
! '\xea', '\xeb', '\xec', '\xed',
! '\xdf', '\xde', '\x9c', '\x9d' };
static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] =
! { '\xaa', '\xab', '\xac', '\xad',
! '\xba', '\xbb', '\xbc', '\xbd',
! '\xca', '\xcb', '\xcc', '\xcd',
! '\xda', '\xdb', '\xdc', '\xdd' };
/* Insert and extract the block size in the header. */
--- 537,556 ----
- XMALLOC_OVERRUN_CHECK_SIZE)
static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] =
! {
! '\x9a', '\x9b', '\xae', '\xaf',
! '\xbf', '\xbe', '\xce', '\xcf',
! '\xea', '\xeb', '\xec', '\xed',
! '\xdf', '\xde', '\x9c', '\x9d'
! };
static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] =
! {
! '\xaa', '\xab', '\xac', '\xad',
! '\xba', '\xbb', '\xbc', '\xbd',
! '\xca', '\xcb', '\xcc', '\xcd',
! '\xda', '\xdb', '\xdc', '\xdd'
! };
/* Insert and extract the block size in the header. */
***************
*** 1135,1142 ****
}
abase = ABLOCK_ABASE (free_ablock);
! ABLOCKS_BUSY (abase) =
! (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
val = free_ablock;
free_ablock = free_ablock->x.next_free;
--- 1139,1146 ----
}
abase = ABLOCK_ABASE (free_ablock);
! ABLOCKS_BUSY (abase)
! = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
val = free_ablock;
free_ablock = free_ablock->x.next_free;
***************
*** 1728,1735 ****
presence of this cookie during GC. */
#define GC_STRING_OVERRUN_COOKIE_SIZE 4
! static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
! { '\xde', '\xad', '\xbe', '\xef' };
#else
#define GC_STRING_OVERRUN_COOKIE_SIZE 0
--- 1732,1739 ----
presence of this cookie during GC. */
#define GC_STRING_OVERRUN_COOKIE_SIZE 4
! static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE]
! = { '\xde', '\xad', '\xbe', '\xef' };
#else
#define GC_STRING_OVERRUN_COOKIE_SIZE 0
***************
*** 1774,1786 ****
STRING_BYTES_BOUND, nor can it be so long that the size_t
arithmetic in allocate_string_data would overflow while it is
calculating a value to be passed to malloc. */
! static ptrdiff_t const STRING_BYTES_MAX =
! min (STRING_BYTES_BOUND,
! ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD
! - GC_STRING_EXTRA
! - offsetof (struct sblock, first_data)
! - SDATA_DATA_OFFSET)
! & ~(sizeof (EMACS_INT) - 1)));
/* Initialize string allocation. Called from init_alloc_once. */
--- 1778,1790 ----
STRING_BYTES_BOUND, nor can it be so long that the size_t
arithmetic in allocate_string_data would overflow while it is
calculating a value to be passed to malloc. */
! static ptrdiff_t const STRING_BYTES_MAX
! = min (STRING_BYTES_BOUND,
! ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD
! - GC_STRING_EXTRA
! - offsetof (struct sblock, first_data)
! - SDATA_DATA_OFFSET)
! & ~(sizeof (EMACS_INT) - 1)));
/* Initialize string allocation. Called from init_alloc_once. */
***************
*** 1802,1809 ****
ptrdiff_t
string_bytes (struct Lisp_String *s)
{
! ptrdiff_t nbytes =
! (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte);
if (!PURE_POINTER_P (s)
&& s->data
--- 1806,1813 ----
ptrdiff_t
string_bytes (struct Lisp_String *s)
{
! ptrdiff_t nbytes
! = (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte);
if (!PURE_POINTER_P (s)
&& s->data
***************
*** 5685,5693 ****
#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
{
/* Compute average percentage of zombies. */
! double nlive =
! (total_conses + total_symbols + total_markers + total_strings
! + total_vectors + total_floats + total_intervals + total_buffers);
avg_live = (avg_live * ngcs + nlive) / (ngcs + 1);
max_live = max (nlive, max_live);
--- 5689,5697 ----
#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
{
/* Compute average percentage of zombies. */
! double nlive
! = (total_conses + total_symbols + total_markers + total_strings
! + total_vectors + total_floats + total_intervals + total_buffers);
avg_live = (avg_live * ngcs + nlive) / (ngcs + 1);
max_live = max (nlive, max_live);
next prev parent reply other threads:[~2012-07-31 23:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1SvWBA-00078u-9A@vcs.savannah.gnu.org>
2012-07-30 22:33 ` [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style Stefan Monnier
2012-07-30 22:47 ` Paul Eggert
2012-07-30 23:11 ` Stefan Monnier
2012-07-30 23:32 ` Paul Eggert
2012-07-31 6:06 ` Richard Stallman
2012-07-31 6:24 ` Paul Eggert
2012-07-31 22:31 ` Richard Stallman
2012-07-31 23:28 ` Paul Eggert [this message]
2012-08-01 3:39 ` Richard Stallman
2012-08-01 23:31 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50186A12.9080302@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.