emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to mod


From: Eli Zaretskii
Subject: Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules.
Date: Wed, 26 Jun 2024 18:53:08 +0300

> From: "Brennan Vincent" <brennan@umanwizard.com>
> 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.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]