pike.git / CHANGES

version» Context lines:

pike.git/CHANGES:721:    +-A---foo      o Individual parent object pointers are now only kept when needed    In Pike 7.0 and 7.2 all objects kept a pointer to the surrounding    object. This led to an excess of circular datastructures, which    ment that the garbage collector had to kick in more often. In Pike    7.4 parent object pointers are only kept if the object actually    refers to identifiers in the parent. This change however affects    the behaviour of object_program() and function_object().    +  Examples: +  +  > class A { +  >> int q; +  >> class B { +  >> int inq(){return q++;} +  >> } +  >> class C { +  >> int q; +  >> int inq(){return q++;} +  >> } +  >> } +  > indices(A); +  (1) Result: ({ /* 1 element */ +  "C" +  }) +  +  C doesn't refer to variables in surrounding classes, and is thus +  constant. +  +  > object a = A(); +  > object b = a->B(); +  > object c = a->C(); +  > function_object(object_program(b)); +  (2) Result: HilfeInput()->A() +  > function_object(object_program(c)); +  (3) Result: HilfeInput()->A +  > function_object(object_program(b)) == a; +  (4) Result: 1 +  > function_object(object_program(c)) == A; +  (5) Result: 1 +  +  The b object has an intact parent object pointer, while the c +  object only has a parent program pointer. +    o __pragma_save_parent__    To change the default parent object pointer behaviour to the    Pike 7.0/7.2 default it is possible to    add_constant("__pragma_save_parent__", 1).      o #pragma save_parent    To get the Pike 7.0/7.2 parent object pointer behaviour for a    single compilation unit use the #pragma save_parent.      o #pragma dont_save_parent