PHP Internals folks--
I'm working on the opcode cache part of Wincache, and I believe that Wincache isn't properly handling the scope and prototype fields of the zend_op_array struct when copying it into shared memory.
I tried looking at the Zend Opcache code to figure out what The Right Way(TM) to handle these fields, and I'm curious about how these fields are used by the Zend engine.
From what I can tell, Zend Opcache has a per-process HashTable where it keeps track of which items is has copied into shared memory (xlat_table).
It looks like the xlat_table is cleared out before each compilation. When persisting, Zend persists things in the following order:
3. zend_op_array (for the main zend_op_array produced by compile)
* Is there some guarantee that the scope and prototype on the main zend_op_array exist in the function_table and class_table for the compilation?
* Does the scope and prototype fields really matter for the main zend_op_array? Wincache has been setting them to NULL since day 1, and everything seems to work just fine...
* The xlat_table key is a ulong. Zend Opcache uses the pointer of an object as the key. On Windows, a ulong is 32 bits. How does this even work on an x64 Windows box?