[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.)
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., (continued)
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/22
- Message not available
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/22
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Andrea Corallo, 2024/06/23
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/24
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Brennan Vincent, 2024/06/25
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., tomas, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., tomas, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Brennan Vincent, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules.,
Eli Zaretskii <=
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Brennan Vincent, 2024/06/26
- Re: [PATCH] Add a mechanism for passing unibyte strings from lisp to modules., Eli Zaretskii, 2024/06/27