[Top][All Lists]

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

Re: Proposal: block-based vector allocator

From: Dmitry Antipov
Subject: Re: Proposal: block-based vector allocator
Date: Fri, 01 Jun 2012 11:34:52 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

On 06/01/2012 01:16 AM, Stefan Monnier wrote:

-  return (p == m->start&&  m->type == MEM_TYPE_VECTORLIKE);
+  if (m->type == MEM_TYPE_VECTORLIKE)
+    {
+      if (m->end - m->start == VECTOR_BLOCK_BYTES)

Please just use a new MEM_TYPE, so we don't need to worry about the
possibility of having a non-vector-block which just happens to have the
same size as a vector-block.

I don't understand this. Any block-allocated vector P0 has the size less than
or equal to VECTOR_BLOCK_BYTES. So, mem_find (P0) will always return mem_node
M0 where M0->end - M0->start == VECTOR_BLOCK_BYTES (IOW, such a mem_node always
corresponds to a vector block). If P1's size is greater than VECTOR_BLOCK_BYTES,
including the case when it's equal to sizeof (vector_block), mem_find (P1) will
always return it's own corresponding node M1 where P1 is equal to M1->start and
M1->end - M1->start is never equal to VECTOR_BLOCK_BYTES.


reply via email to

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