From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#16901: 24.3.50; emacs_backtrace.txt
Date: Tue, 04 Mar 2014 05:45:06 +0200
Message-ID: <83iorusk3h.fsf@gnu.org>
References: <b93ed3b6-293d-44cd-959a-3933ccb4bcae@default>
	<831tylvkq2.fsf@gnu.org>
	<CAAeL0SRk9UcAWk2rG-8zMspSn94LRnn4cXrc_iJbPt84cgRLOQ@mail.gmail.com>
	<83lhwstu1k.fsf@gnu.org> <83ppm3rznz.fsf@gnu.org>
	<53150E29.7080504@cornell.edu>
Reply-To: Eli Zaretskii <eliz@gnu.org>
NNTP-Posting-Host: plane.gmane.org
X-Trace: ger.gmane.org 1393904771 23594 80.91.229.3 (4 Mar 2014 03:46:11 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 4 Mar 2014 03:46:11 +0000 (UTC)
Cc: 16901@debbugs.gnu.org, lekktu@gmail.com, dmantipov@yandex.ru
To: Ken Brown <kbrown@cornell.edu>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 04 04:46:19 2014
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1WKgJ8-0001RJ-Ey
	for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Mar 2014 04:46:18 +0100
Original-Received: from localhost ([::1]:42810 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1WKgJ6-0007B7-O2
	for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Mar 2014 22:46:16 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40029)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1WKgIx-000770-HJ
	for bug-gnu-emacs@gnu.org; Mon, 03 Mar 2014 22:46:12 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1WKgIs-0005LD-Jv
	for bug-gnu-emacs@gnu.org; Mon, 03 Mar 2014 22:46:07 -0500
Original-Received: from debbugs.gnu.org ([140.186.70.43]:48514)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1WKgIs-0005L9-Gw
	for bug-gnu-emacs@gnu.org; Mon, 03 Mar 2014 22:46:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1WKgIr-00088u-RG
	for bug-gnu-emacs@gnu.org; Mon, 03 Mar 2014 22:46:01 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 04 Mar 2014 03:46:01 +0000
Resent-Message-ID: <handler.16901.B16901.139390472931246@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 16901
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: moreinfo
Original-Received: via spool by 16901-submit@debbugs.gnu.org id=B16901.139390472931246
	(code B ref 16901); Tue, 04 Mar 2014 03:46:01 +0000
Original-Received: (at 16901) by debbugs.gnu.org; 4 Mar 2014 03:45:29 +0000
Original-Received: from localhost ([127.0.0.1]:49696 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1WKgIK-00087t-PJ
	for submit@debbugs.gnu.org; Mon, 03 Mar 2014 22:45:29 -0500
Original-Received: from mtaout21.012.net.il ([80.179.55.169]:51848)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <eliz@gnu.org>) id 1WKgID-00087f-GL
	for 16901@debbugs.gnu.org; Mon, 03 Mar 2014 22:45:23 -0500
Original-Received: from conversion-daemon.a-mtaout21.012.net.il by
	a-mtaout21.012.net.il (HyperSendmail v2007.08) id
	<0N1W009007DU2300@a-mtaout21.012.net.il> for 16901@debbugs.gnu.org;
	Tue, 04 Mar 2014 05:45:19 +0200 (IST)
Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0N1W0085P7RJQU80@a-mtaout21.012.net.il>;
	Tue, 04 Mar 2014 05:45:19 +0200 (IST)
In-reply-to: <53150E29.7080504@cornell.edu>
X-012-Sender: halo1@inter.net.il
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 140.186.70.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.bugs:86515
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/86515>

> Date: Mon, 03 Mar 2014 18:20:09 -0500
> From: Ken Brown <kbrown@cornell.edu>
> CC: 16901@debbugs.gnu.org, dmantipov@yandex.ru
> 
> If adj == 0 in line 1596, then we've allocated much more memory than
> we needed, and the next call to malloc (line 1602) allocates even
> more.  And if adj == 1 in line 1596, then we've allocated exactly as
> much memory as we needed, so there's no need to call malloc again in
> line 1602.

Thanks for reviewing.

These are further optimizations, and can (and probably should) be done
in separate commits.  But you aren't saying that the previous code was
correct, are you?