Changes between Version 19 and Version 22 of Ticket #24135


Ignore:
Timestamp:
11/02/17 22:12:08 (3 years ago)
Author:
jdemeyer
Comment:

Replying to tscrim:

However, multiple patchbots are reporting multiple random seg faults. So something seems to be subtly breaking.

I know, that was because I made a mistake in __dealloc__. I fixed that now, so we need to wait for new patchbot reports.

By the way, I realize that I'm making quite a lot of changes in this ticket. What started as a plan to fix the iteritems() calls ended up rewriting most of the coerce_dict.pyx file. However, most changes are pretty simple and do not change the functionality at all.

If there are certain changes that you cannot accept (either because you disagree or you don't understand), I can try to revert those.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24135

    • Property Commit changed from 347a7c544f589d5306b14f24d51ba8da41cfa535 to 87a01932994209c9581c90e21de2e8c9e3573970
  • Ticket #24135 – Description

    v19 v22  
    995. Rename the `iteritems()` method to `items()`.
    1010
    11 6. Introduce a new inline function `valid(ptr)` to replace the very common `ptr != NULL and ptr != dummy`
     116. Introduce a new inline function `valid(ptr)` to replace the very common `ptr != NULL and ptr != dummy`.
    1212
    13137. Change type of `key_id` from `void*` to `PyObject*`. This avoids a lot of casts.
     
    17179. In `tp_clear`, only delete references to elements contained in the dict. Move deallocation of the data structure to `__dealloc__`.
    1818
    19 10. Use random 31-bit multipliers (instead of `13` and `503`) in the hash function for `TripleDict`.
     1910. Use random 31-bit multipliers (instead of `13` and `503`) in the hash function for `TripleDict`. This might give better mixing for large sizes (in any case, it can't hurt).
    2020
    21 11. Rename `dummy` -> `deleted_key` to make it more clear what it means.
     2111. Rename `dummy` -> `deleted_key` to make it more clear what it means. Also, there was no reason that this was of type `bytes`. Now it is simply created by `object()`.
    2222
    232312. Change the logic of the `lookup()` methods a bit to make them easier to understand.