1. Pypy
  2. Untitled project
  3. pypy

Source

pypy / pypy / module / cppyy / executor.py

Diff from to

File pypy/module/cppyy/executor.py

 NULL = lltype.nullptr(jit_libffi.FFI_TYPE_P.TO)
 
 class FunctionExecutor(object):
+    _immutable_fields_ = ['libffitype']
+
     libffitype = NULL
 
     def __init__(self, space, extra):
 
 
 class PtrTypeExecutor(FunctionExecutor):
+    _immutable_fields_ = ['libffitype', 'typecode']
+
     libffitype = jit_libffi.types.pointer
     typecode = 'P'
 
 
 
 class VoidExecutor(FunctionExecutor):
+    _immutable_fields_ = ['libffitype']
+
     libffitype = jit_libffi.types.void
 
     def execute(self, space, cppmethod, cppthis, num_args, args):
 
 
 class InstancePtrExecutor(FunctionExecutor):
+    _immutable_fields_ = ['libffitype', 'cppclass']
+
     libffitype = jit_libffi.types.pointer
 
     def __init__(self, space, cppclass):
 
     for c_type, stub, names in type_info:
         class BasicExecutor(ffitypes.typeid(c_type), NumericExecutorMixin, FunctionExecutor):
+            _immutable_ = True
             c_stubcall  = staticmethod(stub)
         class BasicRefExecutor(ffitypes.typeid(c_type), NumericRefExecutorMixin, FunctionExecutor):
+            _immutable_fields_ = ['libffitype']
             libffitype = jit_libffi.types.pointer
         for name in names:
             _executors[name]              = BasicExecutor
 
     for tcode, names in ptr_info:
         class PtrExecutor(PtrTypeExecutor):
+            _immutable_fields_ = ['typecode']
             typecode = tcode
         for name in names:
             _executors[name+'*'] = PtrExecutor