@@ -738,6 +738,34 @@ private void growToHold(int idx, int required) {
738
738
}
739
739
}
740
740
741
+ /* Goes through the list of repossessions and serializes them all. */
742
+ private void serializeRepossessions () {
743
+ /* Allocate table space, provided we've actually something to do. */
744
+ int numRepos = sc .rep_indexes .size ();
745
+ if (numRepos == 0 )
746
+ return ;
747
+ growToHold (REPOS , numRepos * REPOS_TABLE_ENTRY_SIZE );
748
+
749
+ /* Make entries. */
750
+ for (int i = 0 ; i < numRepos ; i ++) {
751
+ int objIdx = sc .rep_indexes .get (i ) >> 1 ;
752
+ int isST = sc .rep_indexes .get (i ) & 1 ;
753
+ SerializationContext origSC = sc .rep_scs .get (i );
754
+
755
+ /* Work out original object's SC location. */
756
+ int origSCIdx = getSCId (origSC );
757
+ int origIdx = isST != 0
758
+ ? origSC .root_stables .indexOf (sc .root_stables .get (objIdx ))
759
+ : origSC .root_objects .indexOf (sc .root_objects .get (objIdx ));
760
+
761
+ /* Write table row. */
762
+ outputs [REPOS ].putInt (isST );
763
+ outputs [REPOS ].putInt (objIdx );
764
+ outputs [REPOS ].putInt (origSCIdx );
765
+ outputs [REPOS ].putInt (origIdx );
766
+ }
767
+ }
768
+
741
769
/* This is the overall serialization loop. It keeps an index into the list of
742
770
* STables and objects in the SC. As we discover new ones, they get added. We
743
771
* finished when we've serialized everything. */
@@ -777,7 +805,6 @@ private void serializationLoop() {
777
805
778
806
/* Finally, serialize repossessions table (this can't make any more
779
807
* work, so is done as a separate step here at the end). */
780
- /* XXX */
781
- /*serializeRepossessions();*/
808
+ serializeRepossessions ();
782
809
}
783
810
}
0 commit comments