Steven Schveighoffer <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #3 from Steven Schveighoffer <> 2011-06-09 
11:58:55 PDT ---
I think this is a good idea to do, but the code is somewhat obfuscated.  For
example, you are returning a value from a void function (extend), and doing
some weird shortcuts (like !false*2).  There are also some style differences
from the current D style guidelines.  These will have to be fixed before it's
put into phobos.

One technical point -- the limit of multiples of page sizes when requesting
more than one page is already done by the GC.  That is, If you request more
than 1/2 page, you will get a multiple of pages.  I think the code will perform
exactly as well if the multiple-of-page limitation is removed from your code,
and this then does not make any assumptions about how big a page size is (if it
ever changes).

Do you want to do a pull request and have the code reviewed?  I think it's
definitely worth changing Appender to do this.

One further thing -- I planned on making two versions of Appender: one that is
a reference type, and one that is not.  The version that is not should allow
filling an existing an array without allocating anything.  The current Appender
(the one in phobos now) always allocates an pImpl struct, even if the array
never needs to be extended.

The tradeoff is that the non-reference appender is not returnable, and you
can't make copies of it (i.e. this(this) is @disabled).

Is this possible with your code?  If so, and it's easy enough, can you create a
version that does this too?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to