[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_S
From: |
Dmitry Antipov |
Subject: |
Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings] |
Date: |
Thu, 04 Sep 2014 18:46:54 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
On 09/04/2014 05:37 PM, Dmitry Antipov wrote:
Thanks to Paul, there is a C99-compilant solution:
As for the vectors, I don't know how to use VLAs in the way similar
to alloca in the following attempt:
INLINE Lisp_Object
local_vector_init (uintptr_t addr, ptrdiff_t length, Lisp_Object init)
{
ptrdiff_t i;
struct Lisp_Vector *v = (struct Lisp_Vector *) addr;
v->header.size = length;
for (i = 0; i < length; i++)
v->contents[i] = init;
return make_lisp_ptr (v, Lisp_Vectorlike);
}
#define local_vector(obj, length, init) \
(MAX_ALLOCA < (length) * word_size + header_size \
? Fmake_vector (make_number (length), (init)) \
: (obj = XIL ((uintptr_t) alloca ((length) * word_size + header_size)), \
local_vector_init ((uintptr_t) XLI (obj), (length), (init))))
Users are expected to call:
Lisp_Object obj = local_vector (obj, 10, Qnil);
Somewhat similar may be implemented for strings.
Dmitry
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], (continued)
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Paul Eggert, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Paul Eggert, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Stefan Monnier, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings],
Dmitry Antipov <=
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Paul Eggert, 2014/09/04
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Stefan Monnier, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Paul Eggert, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Paul Eggert, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Stefan Monnier, 2014/09/05
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/08
- Re: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings], Dmitry Antipov, 2014/09/08