From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: NS port: How to debug excessive garbage collection? Date: Sun, 14 Apr 2019 22:19:47 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230294"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eliz@gnu.org, dancol@dancol.org, emacs-devel@gnu.org To: Alex Gramiak Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 15 07:20:31 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFu2h-000xiJ-5g for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2019 07:20:31 +0200 Original-Received: from localhost ([127.0.0.1]:44857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFu2g-0006kL-2S for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2019 01:20:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFu22-0006k3-TN for emacs-devel@gnu.org; Mon, 15 Apr 2019 01:19:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFu21-0003rd-Ph for emacs-devel@gnu.org; Mon, 15 Apr 2019 01:19:50 -0400 Original-Received: from gateway21.websitewelcome.com ([192.185.45.210]:27795) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFu21-0003r8-B0 for emacs-devel@gnu.org; Mon, 15 Apr 2019 01:19:49 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 7909D400CC4DB for ; Mon, 15 Apr 2019 00:19:48 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id Fu20hdLlPdnCeFu20hQV8i; Mon, 15 Apr 2019 00:19:48 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JpgEbeDjIU8K7dt5In/pVTRoaqb7wFsyx0qlmOvSSYY=; b=jf5+5OuFPkDBtZmcBIJUcrs2Ss S672uD5lzGelHU2MVdhRttFKML6mxrHYzZJCzWzNYK44rAYrcR855KXN3Mdi08ATzsRWSDkACTpEd uR0YY0AdDwQUJjqfHn6Zknzq5gHWYb005jnWmsa+AriIv8yTtjXmi6X+I2X56ktKPqSzkYQMdGnkG fhTikPllCYDZ/DOpDgUkHBl+L5T1a3vLTDRXSKs12ElO010XBkZXoJ2cFNDXeTuYE6MdXaosJ7+Ll B/gcYI/WKVMSeK1sUhtcmaVBY3h/XLmRoenobH9RAsWKePEK/gBNxO/5fcYJZCtCMOYJSmmOvnwkF 4sY6Z9Vg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51064 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hFu1z-0000xm-IF; Mon, 15 Apr 2019 00:19:47 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hFu1z-0000xm-IF X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51064 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.45.210 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:235474 Archived-At: Thank you, Alex, for the example structs and also for the zeroing out example -- greatly appreciated! Yes, 250 fake cursors is an arbitrary upper limit based upon my own imagination of how many a user might reasonably use in any given window. The crosshairs feature uses approximately that amount per window. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [04-14-2019 20:44:41] <14 Apr 2019 21:44:41 -0600> > From: Alex Gramiak > To: Keith David Bershatsky > Cc: eliz@gnu.org, dancol@dancol.org, emacs-devel@gnu.org > Subject: Re: NS port: How to debug excessive garbage collection? > > * * * > > > Each window cache should be able to handle up to 250 fake cursors. > > Is 250 an arbitrary limit? > > > How do you recommend that the array for each window cache be initialized? > > > > 1. int x > > 2. int fx > > 3. int y > > 4. int fy > > 5. int hpos > > 6. int vpos > > 7. int wd > > 8. int h > > 9. int cursor_type > > 10. int cursor_width > > 11. double foreground_red > > 12. double foreground_green > > 13. double foreground_blue > > 14. double background_red > > 15. double background_green > > 16. double background_blue > > 17. bool active_p > > 18. int glyph_flavor > > To change it to a struct (with a helper struct): > > struct RGB > { > double red; > double green; > double blue; > }; > > struct multiple_cursor_cache > { > int x; > int fx; > int y; > int fy; > int hpos; > int vpos; > int wd; > int h; > int cursor_type; > int cursor_width; > struct RGB foreground; > struct RGB background; > bool active_p; > int glyph_flavor; > }; > > Then you have: > > struct multiple_cursor_cache mc_cache; > > and to set elements: > > w->mc_cache.x = x; > w->mc_cache.foreground.red = red; > > To set all elements to zero, one does: > > memset (&variable, 0, sizeof (variable));