From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#65491: [PATCH] Improve performance allocating vectors Date: Sat, 16 Sep 2023 19:03:33 +0200 Message-ID: References: <6B2EDD07-AAEB-40E8-B369-F634296BD3D9@gmail.com> <83v8cagkqv.fsf@gnu.org> <83ttrugkj2.fsf@gnu.org> <83sf7egitx.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36141"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65491@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 16 19:04:09 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qhYiG-00099e-K5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Sep 2023 19:04:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhYi6-0008MI-85; Sat, 16 Sep 2023 13:03:58 -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 1qhYi4-0008M8-Vo for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 13:03:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhYi3-000693-KM for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 13:03:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhYiA-0004D2-5E for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 13:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Sep 2023 17:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65491-submit@debbugs.gnu.org id=B65491.169488383216154 (code B ref 65491); Sat, 16 Sep 2023 17:04:02 +0000 Original-Received: (at 65491) by debbugs.gnu.org; 16 Sep 2023 17:03:52 +0000 Original-Received: from localhost ([127.0.0.1]:48470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhYi0-0004CU-5a for submit@debbugs.gnu.org; Sat, 16 Sep 2023 13:03:52 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:51358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhYhw-0004CE-Ts for 65491@debbugs.gnu.org; Sat, 16 Sep 2023 13:03:51 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bf66a32f25so49804111fa.2 for <65491@debbugs.gnu.org>; Sat, 16 Sep 2023 10:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694883815; x=1695488615; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=6LZRVKtJxbt27vAzemoK0vZbfgDDZ4MnpuSuoPptUfU=; b=F7undlMuKmv0Vyso8Pn8zlnp2fs/u3VCGfb3BQtINwu5gM0CAki6Qh1umylmlYTKzA kpRF3s0USjG2D+Fw6PJzdN9WrcQtAzBMcujvOLUVMoT0eq+lfQILHE5r2e9OVBEqN6rq qP3+XWfpuzOvCr90PkpUNtsW0eZGVR+IvluizYwIdg7heJuy1kkHlPcODPc08d+X58sm VKu5OOupUGul2nOE/4V7Vv2LW1Du3nE6pZo9B/g99FQpebpIJEgCnh8djabmgKlaCkvu c6Z0I5jSqCqL4uao64VzwbP1L8soFqAWFj3F+mXjsvbEGsfTx+3gPX6wDhkWc9/bfyL7 fZww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694883815; x=1695488615; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6LZRVKtJxbt27vAzemoK0vZbfgDDZ4MnpuSuoPptUfU=; b=WpT70dSFc4Z/brKgQTqWKTwEvivyVrjguIoKMvOsAGEPa5+d5gRUXsMqZMXOYmBYhG /QPYP4ly/ee1uFCFAO6Vpyt6R0QCeq4umbw0nYJnRlMl9JNpgZikHXMhQp277zhyf4dR cv3I9tfyormajHGrjdT5W06hGLnQjIP47fRwS6/fKsOuXpy3DDyGzOB0P5KWGbPgL6wy WH95cRfZ9nnczJpj2C+3PAVArqsc+S2tDSVpAvNo7GeyiU6Xl5vcQOesTSAhaeJDG1yV WYRcUZN1xSRf/nPHn7T2X/bBbiV4p/wy3/LhJQpUlfl+DbbB7Bc4dKWwcWktyLhsuTRG KBAg== X-Gm-Message-State: AOJu0YzzxDt7X1vXN27q3e1ItdqKeclJIDsz/faVd1lBSa0e8xulwjVA OLR3Gv7UCjfaRNufK8AuKls= X-Google-Smtp-Source: AGHT+IFxT7JwgcmTHnR41f9WhsiEnmy7uxYyIcdf+MY4aa4gyVKIthGj+kDg2S64CXPi7KD0ChIAYg== X-Received: by 2002:a05:651c:149:b0:2b9:c4f6:fdd with SMTP id c9-20020a05651c014900b002b9c4f60fddmr4137189ljd.14.1694883815230; Sat, 16 Sep 2023 10:03:35 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id r7-20020a2eb607000000b002bf7fd1d336sm1243792ljn.14.2023.09.16.10.03.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Sep 2023 10:03:34 -0700 (PDT) In-Reply-To: <83sf7egitx.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270637 Archived-At: 16 sep. 2023 kl. 18.54 skrev Eli Zaretskii : > It does, but LISP_WORD_TAG(type) is a 64=3Dbit type with the only bits > set above 32 bit, so how casting it to uintptr_t is TRT? Because XUNTAG is used to get the pointer part; we don't want the tag = bits.=20 > Why did you need to change the original cast in the first place? The commit message tried to explain that, but in essence, the old code = untagged a Lisp_Object value by casting it to char *, then do pointer = arithmetic on that, and then cast the result to whatever pointer we = want. The C standard severely restricts pointer arithmetic: in particular, for = P+X where X is an integer and P is a pointer, P cannot be null (nor will = P+X, since both P and P+X must be pointers to objects in the same = array). This means that XUNTAG could never reliably untag a null pointer and = this did cause mayhem in some places. We have just been lucky not to = trigger it so far but I noticed when attempting to make some = innocent-looking changes.