Ticket #95: cage clean.patch
| File cage clean.patch, 4.4 KB (added by jimmy, 4 years ago) |
|---|
-
src/jit.c
366 366 else if (flags & KEY_string_FLAG) 367 367 typ = 2; 368 368 369 if (n < NUM_REGISTERS) { 370 if (!ru[typ].reg_count[n]++) 371 ru[typ].reg_dir[n] |= PARROT_ARGDIR_IN; 372 } 369 if (n < NUM_REGISTERS && !ru[typ].reg_count[n]++) 370 ru[typ].reg_dir[n] |= PARROT_ARGDIR_IN; 373 371 } 374 372 key = key_next(interp, key); 375 373 } -
src/list.c
652 652 int do_sparse = (INTVAL)idx - (INTVAL)list->cap >= 10 * MAX_ITEMS; 653 653 654 654 if (list->item_type == enum_type_sized) { 655 items = list->items_per_chunk; 656 size = items * list->item_size; 655 do_sparse = 0; 656 items = list->items_per_chunk; 657 size = items * list->item_size; 658 657 659 list->grow_policy = items == MAX_ITEMS ? 658 660 enum_grow_fixed : enum_grow_mixed; 659 do_sparse = 0;660 661 } 661 662 else if (do_sparse) { 662 663 PARROT_ASSERT(where); 663 664 /* don't add sparse chunk at start of list */ 664 665 if (!list->n_chunks) { 665 list->grow_policy = enum_grow_fixed; 666 do_sparse = 0; 667 items = MAX_ITEMS; 668 666 669 /* if wee need more, the next allocation will allocate the rest */ 667 items = MAX_ITEMS;668 670 size = items * list->item_size; 669 do_sparse = 0;671 list->grow_policy = enum_grow_fixed; 670 672 } 671 673 else { 674 /* allocate a dummy chunk holding many items virtually */ 675 size = list->item_size; 672 676 items = idx - list->cap - 1; 677 673 678 /* round down this function will then be called again, to add the 674 679 * final real chunk, with the rest of the needed size */ 675 680 items &= ~(MAX_ITEMS - 1); 676 681 list->grow_policy = enum_grow_mixed; 677 /* allocate a dummy chunk holding many items virtually */678 size = list->item_size;679 682 } 680 683 } 681 684 /* initial size for empty lists grow_policy is not yet known or was … … 752 755 if (where) { /* at end */ 753 756 if (chunk) 754 757 chunk->next = new_chunk; 755 list->last = new_chunk;756 758 if (!list->first) 757 759 list->first = new_chunk; 760 761 list->last = new_chunk; 758 762 } 759 763 else { 760 764 new_chunk->next = chunk; -
src/pmc/role.pmc
296 296 */ 297 297 298 298 VTABLE void add_attribute(STRING *name, PMC *type) { 299 Parrot_Role_attributes * const role = PARROT_ROLE(SELF);300 PMC * const new_attribute= pmc_new(interp, enum_class_Hash);299 Parrot_Role_attributes * const role = PARROT_ROLE(SELF); 300 PMC * const new_attribute = pmc_new(interp, enum_class_Hash); 301 301 302 302 /* Set name and type. */ 303 303 VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name); … … 486 486 487 487 VTABLE STRING *get_string() { 488 488 Parrot_Role_attributes * const role = PARROT_ROLE(SELF); 489 PMC * const _namespace = role->_namespace;489 PMC * const _namespace = role->_namespace; 490 490 491 491 if (!PMC_IS_NULL(_namespace)) { 492 492 /* Call the 'get_name' method on the role's associated namespace … … 586 586 587 587 METHOD name(STRING *name :optional, int got_name :opt_flag) { 588 588 Parrot_Role_attributes *role = PARROT_ROLE(SELF); 589 STRING *ret_name = NULL;589 STRING *ret_name = NULL; 590 590 591 591 if (got_name) { 592 592 /* We'll build a hash just containing the name, then give this to … … 613 613 */ 614 614 615 615 METHOD get_namespace() { 616 Parrot_Role_attributes *role = PARROT_ROLE(SELF);617 PMC *ret_namespace = role->_namespace;616 Parrot_Role_attributes *role = PARROT_ROLE(SELF); 617 PMC *ret_namespace = role->_namespace; 618 618 RETURN(PMC *ret_namespace); 619 619 } 620 620
