guile-devel
[Top][All Lists]
Advanced

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

Re: [BDW-GC] "Inlined" storage; `scm_take_' functions


From: Neil Jerram
Subject: Re: [BDW-GC] "Inlined" storage; `scm_take_' functions
Date: Wed, 09 Sep 2009 00:54:13 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hello!

Hi!

> Stringbufs and bytevectors are now always "inlined" in the BDW-GC
> branch [0, 1], which means that there's no cell->buffer indirection,
> which greatly simplifies code (it also takes less room and may slightly
> improve performance).
>
> The `scm_take_' functions for strings/symbols/bytevectors are now
> essentially aliases to the corresponding `scm_from_' because we cannot
> advantageously reuse the provided storage.

That seems a bit of a shame.  (i.e. that we can't advantageously keep
the caller's string or vector data)

Did you consider the option of

- always having an indirection from the stringbuf/bytevector object to
the underlying data

- optimizing the scm_from_... case by doing a single
  scm_gc_malloc_pointerless (), and making the "underlying data
  pointer" point into the same malloc'd block.

The first point should allow a similar simplification of the code as
you have in your commits - by not having to handle both the inline and
indirected cases everywhere - but the indirection would allow us to
keep meaningful scm_take_... functions.

    Neil




reply via email to

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