emacs-devel
[Top][All Lists]
Advanced

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

Re: Set operations on bool-vectors


From: Daniel Colascione
Subject: Re: Set operations on bool-vectors
Date: Fri, 20 Sep 2013 19:44:36 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

On 9/20/13 6:57 PM, Stefan Monnier wrote:
>> === modified file 'src/alloc.c'
>> --- src/alloc.c      2013-09-04 22:34:04 +0000
>> +++ src/alloc.c      2013-09-19 22:24:27 +0000
>> @@ -2003,6 +2003,29 @@
>>    return val;
>>  }
> 
> Could you describe the intention of the changes in alloc.c (basically,
> provide ChangeLog entries)?

Sure.  Something like this?

2013-09-21  Daniel Colascione  <address@hidden>

        * alloc.c (bool_vector_payload_bytes): New function: computes
        rounded-up payload size for a bool vector.  Always allocate
        at least size_t bytes even for a zero-size vector.
        (Fmake_bool_vector): Instead of calling Fmake_vector,
        which performs redundant initialization and argument checking,
        just call allocate_vector ourselves.  Make sure we clear any
        terminating padding to zero.
        (vector_nbytes,sweep_vectors): Use bool_vector_payload_bytes
        instead of open-coding the size calculation.

>> +       doc: /* Compute A = B ^ C, bitwise exclusive or.
> 
> Why not make it C = A ^ B and then make C optional?
> Same for other similar functions: make the destination argument optional.

Then we wouldn't be able to extend these functions to accept more than
three arguments: we wouldn't know whether the argument at the end was
another operand or a destination.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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