deps/PicklingTools170Release/Xm/ptools170/pythoncext/pyocser.cc
bool OCPyBytesToSerializeProxy (PyObject *po, OCPyDumpContext_& dc,
				  size_t* bytes)
{
  *bytes = 1 + 4; // 'P' and int_u4 marker always there!

  // Check to see if already been serialized and get the marker,
  // otherwise we'll just be appending new marker
  PyObjectInfo& pyinfo = dc.objectLookup[po];
  pyinfo.object = po;
  if (pyinfo.times++ == 0) {  // 1 more user
    // First time! Fill in marker
    pyinfo.object = po;
    pyinfo.marker = dc.objectLookup.entries()-1;
    *bytes += 3;   // for adopt, lock, allocator
    return false; // Force check of all bytes
  } else {
    // Already seen, no more bytes needed other than 'P'+ marker
    return true;
  }
}
// Because we want the C++ side to deserialize to Proxys,
// we go ahead and mark EVERY once with a marker, even if it's
// not needed.  We *could* note which objects were only deserialized
// once and just emit a val object, but that subjugates the
// proxyness
Because we want the C++ side to deserialize to Proxys,
we go ahead and mark EVERY once with a marker, even if it's
not needed.  We *could* note which objects were only deserialized
once and just emit a val object, but that subjugates the
proxyness
Because we want the C ++ side to deserialize to Proxys we go ahead and mark EVERY once with a marker even if it ' s not needed . We * could * note which objects were only deserialized once and just emit a val object but that subjugates the proxyness
bool OCPyBytesToSerializeProxy (PyObject *po, OCPyDumpContext_& dc,
				  size_t* bytes)
{
  *bytes = 1 + 4; 
  PyObjectInfo& pyinfo = dc.objectLookup[po];
  pyinfo.object = po;
  if (pyinfo.times++ == 0) {  
    pyinfo.object = po;
    pyinfo.marker = dc.objectLookup.entries()-1;
    *bytes += 3;   
    return false; 
  } else {
    return true;
  }
}
bool OCPyBytesToSerializeProxy ( PyObject * po , OCPyDumpContext_ & dc , size_t * bytes ) { * bytes = 1 + 4 ; PyObjectInfo & pyinfo = dc . objectLookup [ po ] ; pyinfo . object = po ; if ( pyinfo . times ++ == 0 ) { pyinfo . object = po ; pyinfo . marker = dc . objectLookup . entries ( ) - 1 ; * bytes += 3 ; return false ; } else { return true ; } }
Because we want the C++ side to deserialize to Proxys,
we go ahead and mark EVERY once with a marker, even if it's
not needed.
Because we want the C ++ side to deserialize to Proxys we go ahead and mark EVERY once with a marker even if it ' s not needed .
// 'P' and int_u4 marker always there! // Check to see if already been serialized and get the marker, // otherwise we'll just be appending new marker // 1 more user // First time! Fill in marker // for adopt, lock, allocator // Force check of all bytes // Already seen, no more bytes needed other than 'P'+ marker