These are chat archives for dropbox/pyston

20th
Jun 2016
Sun
@Daetalus
Jun 20 2016 16:29

Hi! Why we can't use this comparison? PyCFunction_Type is just a alias of capifunc_cls, right?

        // Pyston change: moved because we call this type 'capifunc'
        /*
        if (type == &PyCFunction_Type) {
            res = save_global(self, args, NULL);
            goto finally;
        }
        */

https://github.com/dropbox/pyston/blob/master/from_cpython/Modules/cPickle.c#L2738

Marius Wachtler
@undingen
Jun 20 2016 16:39
we can use the same comparison (and do use it) but I had to move it to the case 'c': block because class name does not start with the letter b case 'b':
the manually optimized the amount of type comparisons by creating a switch(type->tp_name[0])