emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS: weak hash tables


From: Gerd Möllmann
Subject: Re: MPS: weak hash tables
Date: Sun, 07 Jul 2024 20:29:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: pipcet@protonmail.com,  eller.helmut@gmail.com,  yantar92@posteo.net,
>>   emacs-devel@gnu.org
>> Date: Sun, 07 Jul 2024 20:15:34 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > I understand all that, but unchaining an interval involves the need to
>> > modify the pointers of its adjacent nodes, and how can MPS do that
>> > without understanding our data structures?
>> 
>> Can you please show me what code you mean? 
>
> This one:
>
>   static void
>   sweep_intervals (void)
>   {
>     struct interval_block **iprev = &interval_block;
>     int lim = interval_block_index;
>     object_ct num_free = 0, num_used = 0;
>
>     interval_free_list = 0;
>
>     for (struct interval_block *iblk; (iblk = *iprev); )
>       {
>       int this_free = 0;
>       ASAN_UNPOISON_INTERVAL_BLOCK (iblk);
>       for (int i = 0; i < lim; i++)
>         {
>           if (!iblk->intervals[i].gcmarkbit)
>             {
>               set_interval_parent (&iblk->intervals[i], interval_free_list);
>               interval_free_list = &iblk->intervals[i];
>               ASAN_POISON_INTERVAL (&iblk->intervals[i]);
>               this_free++;
>             }
>           else
>             {
>               num_used++;
>               iblk->intervals[i].gcmarkbit = 0;
>             }
>         }
>       lim = INTERVAL_BLOCK_SIZE;
>       /* If this block contains only free intervals and we have already
>          seen more than two blocks worth of free intervals then
>          deallocate this block.  */
>       if (this_free == INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SIZE)
>         {
>           *iprev = iblk->next;
>           /* Unhook from the free list.  */
>           ASAN_UNPOISON_INTERVAL (&iblk->intervals[0]);
>           interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]);
>           lisp_free (iblk);
>         }
>       else
>         {
>           num_free += this_free;
>           iprev = &iblk->next;
>         }
>       }

Ah!

There are no interval_blocks, no interval_free_list nothing of that in
MPS.



reply via email to

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