PetScan::mark_write: turn into a static function