From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109111: Simple free memory accounting feature. Date: Tue, 17 Jul 2012 17:40:39 +0400 Message-ID: <50056B57.2080705@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010301070403090403040605" X-Trace: dough.gmane.org 1342532321 5693 80.91.229.3 (17 Jul 2012 13:38:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2012 13:38:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 17 15:38:39 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sr7z4-0003vd-RW for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2012 15:38:39 +0200 Original-Received: from localhost ([::1]:47491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr7z0-0000y9-BY for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2012 09:38:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr7yq-0000xl-If for emacs-devel@gnu.org; Tue, 17 Jul 2012 09:38:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sr7yl-0005TV-AQ for emacs-devel@gnu.org; Tue, 17 Jul 2012 09:38:24 -0400 Original-Received: from forward15.mail.yandex.net ([95.108.130.119]:41383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sr7yk-0005TI-BW for emacs-devel@gnu.org; Tue, 17 Jul 2012 09:38:19 -0400 Original-Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward15.mail.yandex.net (Yandex) with ESMTP id B78E79E12A5; Tue, 17 Jul 2012 17:38:16 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342532296; bh=615O+v4kFg4Bs8xW/OKtTueLriAkzfTNjNF0jCEZdBg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=X6n9uDUzQ1+gOLqaSXSLR4D2ydwstSwQbsztLwlTtkt+Zs4IJN8Ce4nq8rYPIa3XJ qJLedQLqJcZ7Q8acrVa/PHdxYQMvGZWLEJqjyMNuwsnf2yEf4ni3uAEZ9RRC/9FhXb 31QTVuyq0Obmz51rXWwGYtJAs0ckOXQGfeZkAsLo= Original-Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id 954747E02E5; Tue, 17 Jul 2012 17:38:16 +0400 (MSK) Original-Received: from 50.gprs.mts.ru (50.gprs.mts.ru [213.87.128.50]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cFVKdrVq-cFVKYRc1; Tue, 17 Jul 2012 17:38:15 +0400 X-Yandex-Rcpt-Suid: monnier@IRO.UMontreal.CA X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342532296; bh=615O+v4kFg4Bs8xW/OKtTueLriAkzfTNjNF0jCEZdBg=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=PuN1wTxQuK8j1ulZJJWuDtUNL9EOWoIkyzVohODKqj67BH1MkR1T4yvd5rylS+csL STQr9EFs0LISER456WYxymmw4AfuO/0140EWOrE6tLXqCZJT+6apCsojEvAWY7cTIM /1AErtkrX9LICHEyc6Za5CL/BEm8sKBigo2uT+PE= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 95.108.130.119 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151708 Archived-At: This is a multi-part message in MIME format. --------------010301070403090403040605 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/17/2012 01:45 PM, Stefan Monnier wrote: > There are two problems, here: > - if the data is unavailable, better return nil than 0. > - we now have 2 ways to get the data, neither of which gives it all: > garbage-collect returns details data but misses the new vector-bytes > and bytes-free, whereas memory-free includes those 2 but only provides > the combined value. > > The first problem is obviously a detail, but the second problem needs to > be fixed. The way I see it, it should be fixed by improving > garbage-collect's return value. The only problem with that is backward > compatibility, but AFAIK there are only 2 users of that data: > memory-usage and chart.el, which we can both fix easily. > I suggest we make garbage-collect return its data in a new format > that is more self-descriptive, like an alist where each entry takes the > form (CATEGORY SIZE USED FREE), where CATEGORY would be a symbol (like > `cons') and SIZE is the size of each element in bytes. OK, look at this. Dmitry --------------010301070403090403040605 Content-Type: text/plain; charset=UTF-8; name="gc.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gc.patch" PT09IG1vZGlmaWVkIGZpbGUgJ2xpc3AvZW1hY3MtbGlzcC9jaGFydC5lbCcKLS0tIGxpc3Av ZW1hY3MtbGlzcC9jaGFydC5lbAkyMDEyLTA1LTEzIDAzOjA1OjA2ICswMDAwCisrKyBsaXNw L2VtYWNzLWxpc3AvY2hhcnQuZWwJMjAxMi0wNy0xNyAxMzowMDoyMiArMDAwMApAQCAtN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3IGRhdGEpKQorCSAobmFtZXMgJygiY29uc2VzIiAic3ltYm9s cyIgIm1pc2NzIiAic3RyaW5ncyIKKwkJICAidmVjdG9ycyIgImZsb2F0cyIgImludGVydmFs cyIgImJ1ZmZlcnMiKSkKKwkgKG51bXMgKGxpc3QgKCogKG50aCAxIGNvbnMtaW5mbykgKG50 aCAyIGNvbnMtaW5mbykpCisJCSAgICAgKCogKG50aCAxIHN5bWJvbC1pbmZvKSAobnRoIDIg c3ltYm9sLWluZm8pKQorCQkgICAgICgqIChudGggMSBtaXNjLWluZm8pIChudGggMiBtaXNj LWluZm8pKQorCQkgICAgICgrICgqIChudGggMSBzdHJpbmctaW5mbykgKG50aCAyIHN0cmlu Zy1pbmZvKSkKKwkJCShudGggMyBzdHJpbmctaW5mbykpCisJCSAgICAgKG50aCAzIHZlY3Rv ci1pbmZvKQorCQkgICAgICgqIChudGggMSBmbG9hdC1pbmZvKSAobnRoIDIgZmxvYXQtaW5m bykpCisJCSAgICAgKCogKG50aCAxIGludGVydmFsLWluZm8pIChudGggMiBpbnRlcnZhbC1p bmZvKSkKKwkJICAgICAoKiAobnRoIDEgYnVmZmVyLWluZm8pIChudGggMiBidWZmZXItaW5m bykpKSkpCiAgICAgOzsgTGV0J3MgY3JlYXRlIHRoZSBjaGFydCEKICAgICAoY2hhcnQtYmFy LXF1aWNraWUgJ3ZlcnRpY2FsICJFbWFjcyBSdW50aW1lIFN0b3JhZ2UgVXNhZ2UiCiAJCSAg ICAgICBuYW1lcyAiU3RvcmFnZSBJdGVtcyIKCj09PSBtb2RpZmllZCBmaWxlICdzcmMvYWxs b2MuYycKLS0tIHNyYy9hbGxvYy5jCTIwMTItMDctMTcgMTI6MzE6MjkgKzAwMDAKKysrIHNy Yy9hbGxvYy5jCTIwMTItMDctMTcgMTM6Mzc6MjQgKzAwMDAKQEAgLTE4NywxMSArMTg3LDI0 IEBACiAKIGludCBhYm9ydF9vbl9nYzsKIAotLyogTnVtYmVyIG9mIGxpdmUgYW5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l9tYXJrZXJf cDsKIAotZXh0ZXJuIExpc3BfT2JqZWN0IFFpbnRlZ2VyOworZXh0ZXJuIExpc3BfT2JqZWN0 IFFpbnRlZ2VyLCBRY29ucywgUXN5bWJvbCwgUW1hcmtlciwgUXN0cmluZzsKK2V4dGVybiBM aXNwX09iamVjdCBRbWlzYywgUXZlY3RvciwgUWZsb2F0LCBRaW50ZXJ2YWwsIFFidWZmZXI7 CiAKIGV4dGVybiBMaXNwX09iamVjdCBRZm9udF9zcGVjLCBRZm9udF9lbnRpdHksIFFmb250 X29iamVjdDsKIAoK --------------010301070403090403040605--