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: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules. Date: Wed, 26 Jun 2024 18:53:08 +0300 Message-ID: <861q4j8zvf.fsf@gnu.org> References: <225D336D-933E-4CA3-B245-89992D7E6C41@umanwizard.com> <86frt5jwtc.fsf@gnu.org> <87o77t6lyn.fsf@taipei.mail-host-address-is-not-set> <867cehgdn1.fsf@gnu.org> <861q4md0o1.fsf@gnu.org> <87jzickjq8.fsf@taipei.mail-host-address-is-not-set> <86wmmb99f7.fsf@gnu.org> <86ikxv96sd.fsf@gnu.org> <87ed8jkc4v.fsf@taipei.mail-host-address-is-not-set> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24423"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomas@tuxteam.de, acorallo@gnu.org, stefankangas@gmail.com, emacs-devel@gnu.org To: "Brennan Vincent" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 26 17:53:39 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 1sMUxm-00064B-O2 for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Jun 2024 17:53:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMUxS-00029c-Ni; Wed, 26 Jun 2024 11:53:18 -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 1sMUxQ-00028i-SW for emacs-devel@gnu.org; Wed, 26 Jun 2024 11:53:16 -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 1sMUxQ-0001cj-FG; Wed, 26 Jun 2024 11:53:16 -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=jU/D0EqHvnwNI3vjlwzyPj3tYfZbmOK0HHw66Hiyp1c=; b=R8dlWieO24q7 3K/EsrSA7KmsEWrEK3oPjfp4+8wsoLsNUU1dZW8jnO8xkeGt2OpQdu5fADsJdjNSRP01vG+7OjqlH KBI0Tdz3xpcd8TXfDTjZE29Np0wYRQ37nVlUEphsr8LR2X5Vd0qb9Pf5PQmdOs7GTFLjJoG5WFSU1 fpy6+D4kET6jB+8iT4a9LzcKfEG02S0wwbJPhxhwMAIEP0Gd1q8AP0d+M78zTxnDypinpeOTe2TzV 504kpBMoo07gqZhfWxA6NM6mUKs3Nmq74OWI+jCl541q3k9tywjpXRZRH6xOmBeF9hmjfYfCjfmF0 Sx4tKNuMYMTSXvjE/ScdfQ==; In-Reply-To: <87ed8jkc4v.fsf@taipei.mail-host-address-is-not-set> (brennan@umanwizard.com) 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:320723 Archived-At: > From: "Brennan Vincent" > Cc: acorallo@gnu.org, stefankangas@gmail.com, emacs-devel@gnu.org > Date: Wed, 26 Jun 2024 10:32:48 -0400 > > > Maybe I'm all wrong, but AFAIU, a vector can contain arbitrary Lisp > > values. That makes 64bits/8bits plus boxing/unboxing (which is, I > > assume, quick, but nonzero). > > > > Yes, this was my reasoning as well. > > (setq foo (make-vector 1000000000 #x00)) > > causes emacs to consume (at least) 8G of RAM, whereas the similar C > code: > > #define SZ 1000000000 > char *foo = malloc(SZ); > memset(foo, 0, SZ); > > only consumes 1G. Why is that a problem? (It's a good-faith question; I know that 8GB is 8 times 1GB, but that cannot be the answer, when long-running Emacs sessions get to several GB memory footprint already, and no one is complaining. And that's even before we ask why would you need 1 billion bytes in an application that reads executable files.)