From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS prstack Date: Mon, 27 May 2024 14:34:31 +0300 Message-ID: <86v82zv67s.fsf@gnu.org> References: <87o790qsgm.fsf@gmail.com> <874jap95hi.fsf@gmail.com> <874janpa4m.fsf@gmail.com> <87le3vogt8.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 27 13:35:21 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 1sBYdM-000A7K-Nn for ged-emacs-devel@m.gmane-mx.org; Mon, 27 May 2024 13:35:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYce-0002PR-87; Mon, 27 May 2024 07:34:36 -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 1sBYcd-0002PH-0H for emacs-devel@gnu.org; Mon, 27 May 2024 07:34:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYcc-0001mu-Lp; Mon, 27 May 2024 07:34:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=18iZ9gX0qV3chX6yE5J+ihFwK06QY57MbuCg+mR3jx8=; b=OZNYgVGx8/W5 6lXNse0aRGAVeYpzVYbIUgwcrXfcxcxV7SvTCUZkpTRpkPWJFV6X6hEq1t6fFEeYCiCGjkn99qlXj jKld1Ibim/YUb765a3NhsvFFWP2hySVshAUyeciExhDS64f6AVUHgpg+M3+f8g27Dbs4Fx9hF1C7f mmYHr0spbjYouPHmcxkFjb7Y9fYgoxW2egW7McGgG5kUJLSb7AgDBBF8RdPl4KpLskTRScPOuw8ue 0MCoOZxZgPfGsye/BXke1DLA7cdszStfXZhDwCncB8D6wWSkuTo3ySicBszU9vSAt2I9mBXIFjKqx Lsf8vJix9MqxCJRd2OVtBA==; In-Reply-To: <87le3vogt8.fsf@gmail.com> (message from Helmut Eller on Mon, 27 May 2024 09:27:31 +0200) 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:319604 Archived-At: > From: Helmut Eller > Cc: Eli Zaretskii , Emacs Devel > Date: Mon, 27 May 2024 09:27:31 +0200 > > Somewhat related: I wonder if this line in print_stack_push is safe: > > prstack.stack[prstack.sp++] = e; > > This is not an atomic operation and prstack.sp gets updated before the > new stack slot is initialized. Are you sure? I think the above assigns e to prstack.stack[prstack.sp], and then increments prstack.sp. What you describe is this instead: prstack.stack[++prstack.sp] = e; By analogy with the original code above, what does the following do? char *s; *s++ = 'a'; AFAIU, it stores 'a' in the address pointed by s and then increments s.