From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS image cache Date: Sun, 05 May 2024 19:45:03 +0200 Message-ID: References: <875xvvp3fo.fsf@gmail.com> <87o79n0wna.fsf@gmail.com> <86ikzseipz.fsf@gnu.org> <86bk5keev3.fsf@gnu.org> <867cg8ed56.fsf@gnu.org> <861q6ge4iy.fsf@gnu.org> <86ttjccl7g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28383"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 05 19:45:40 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s3fvg-0007AX-PK for ged-emacs-devel@m.gmane-mx.org; Sun, 05 May 2024 19:45:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3fvM-00050Y-W7; Sun, 05 May 2024 13:45:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3fvB-0004zS-Ur for emacs-devel@gnu.org; Sun, 05 May 2024 13:45:11 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3fv9-0002is-Sp; Sun, 05 May 2024 13:45:09 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a59a387fbc9so258550966b.1; Sun, 05 May 2024 10:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714931105; x=1715535905; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=L+v0dqqIEcLk7EVTx4X3Lh5fTznMnq9sEn2thvBs3wU=; b=X/gSA4iFLlX0+8JBBL02+ExbUm7rLfomV2f7Y8i0VZyCq111h0s+axRvPXhthhxUfG 5LGyomVr4zPjVIrVktmz5nE4FZ2okx6bms+/jxa9qF7vZvADdCJHyqvouV08VuvFsz+w mekLpS4FgLP57M18o1BD37I2061ibQsa1+bsOiMTzVoPS/Sf0/cilRTb23tSzFjGvl3t bXVPxchfn/1gqQ75EbAw5Ay14z54eND61ZeZL0s7VnpyuCKTWqeZwFzZfPM1Q6Rt/poq eEcR2tNX9NZF+qGVQd57/wN9GdDfmrr7FVhBBC6jk9QHvWiRchBGkAMyKDctL3Zys5l7 gD6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714931105; x=1715535905; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=L+v0dqqIEcLk7EVTx4X3Lh5fTznMnq9sEn2thvBs3wU=; b=acqdpz0uwu2GbC3+h1gNVurA/S/Ior0s/GWxOHdCXDLbaRzGf6WesZCRMTSdOcOf5N EP+Regtl3KizyDuP05MKu7R8OG/zMKfXZNmsjtFZk3qzIeGKmb2QytEy266w3LAD2OhL VdpNF0IQtv0K98ADWhhfjeDtJaotJ5aIBQSe1jorIaxIStrHq3kzKpMSfuFY5cyPcEZZ nt1qObKna7boz5N/wlHhV16TOBAcQY6EWN1YZshD/I0pXZRPP4y1RhVqQs8O31eAcW3O lZkIf73bib25LiTvp/ZXzZVOwuBv4kXHYf84nbP3WsmMDee530LO9RYhtbI58xuk6qlG 1wmQ== X-Forwarded-Encrypted: i=1; AJvYcCX8N2GoQfdGsB0uYymJG1sFD0B9HSwT16BxlrZumnRAfH12uqinPaUZPa4G4E6VC4KI2/QFEUfvD3m5k5Cyn5sg6Xkg X-Gm-Message-State: AOJu0Ywg2vmSNsWrAp1nXAnpTo7vGGAsKYf5fz/gc1vowQxDyRv93v/2 ZrJ6ot1pcFQRdb9FBr6qyAr5rkgmh5EJ9cLS6bBnGkP9rjRL3IDsdi7HOQ== X-Google-Smtp-Source: AGHT+IFBqpuOW5Xy1dRxPO1SR8W8XiZHqvP9Tt98ImVDX6Edz2LsUHoc86qHqiirtChT250LZTi06Q== X-Received: by 2002:a17:906:894:b0:a59:ae6e:486f with SMTP id n20-20020a170906089400b00a59ae6e486fmr1937914eje.65.1714931104989; Sun, 05 May 2024 10:45:04 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a20a.dip0.t-ipconnect.de. [79.227.162.10]) by smtp.gmail.com with ESMTPSA id i20-20020a170906445400b00a59bba81e97sm1228895ejp.126.2024.05.05.10.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 10:45:04 -0700 (PDT) In-Reply-To: <86ttjccl7g.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 18:49:55 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318856 Archived-At: Eli Zaretskii writes: > I fixed the code according to my understanding, please take a look and > tell if I missed something (since the new function does not seem to be > used yet for the two caches you mentioned, it is hard to know whether > I violated some assumptions). This hunk is wrong: @@ -2978,7 +2977,8 @@ igc_make_face_cache (void) void * igc_make_ptr_vec (size_t n) { - return alloc (n * sizeof (void *), IGC_OBJ_PTR_VEC, PVEC_FREE); + return alloc (sizeof (struct igc_header) + (n - 1) * sizeof (void *), + IGC_OBJ_PTR_VEC, PVEC_FREE); } what you removed was correct because alloc takes the size in bytes to allocate from the POV of the client. Alloc computes the size needed from MPS size = obj_size (size); which includes the header among other things.