X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=blobdiff_plain;f=doc%2Forb%2Fmarshalling;h=e62ae48fe7a2a9cf584e31ab63bf8cf072c559b7;hp=ab429bb8e853ee0e27a0e02154c8dbb6ff96f98b;hb=ed94ee97c9872c957efa4790c4ea073f371262a6;hpb=d32da4b91b9a403ae9d65c48fbb25c1abbb5083f diff --git a/doc/orb/marshalling b/doc/orb/marshalling index ab429bb..e62ae48 100644 --- a/doc/orb/marshalling +++ b/doc/orb/marshalling @@ -24,7 +24,7 @@ which contain object ids and/or references to other data chunks are stored at arbitrary locations in segment 0, and are referenced as an offset into the segment. -Data chunks which do not contain object id or references to other +Data chunks which do not contain object ids or references to other data chunks (i.e. they are pure data, and do not need to be altered for marshalling) are stored at arbitrary locations in arbitrary segments. References to these pure data chunks are encoded as a @@ -37,6 +37,37 @@ for 32-bit architectures and 32 for 64-bit architectures. Object references are encoded as pointer-sized offsets into the objlist array. +Virtual structs are prefaced with a header, which consists of +the following, in order: +1. 32-bit length of vstruct, including header, and all referenced +data chunks, which must be contiguously appended to the vstruct body +2. 32-bit offset of start of actual struct +3. 128-bit GUID of the most derived vstruct type +5. 32-bit objlist-offset of the vstruct's object handles, the first +of which is introspection object +6. 32-bit length of vstruct objlist in handles +7. 32-bit offset of an area within the vstruct where the objlist can +be copied. +8. 32-bit reserved field + +The requirement for all referenced data chunks to be contiguous with +the vstruct means that scatter-gather and zero-copy cannot be done; +however, it prevents the loss of derived-type data when only a base +type is known at unmarshalling time (the derived-type data could +later be accessed through introspection, or be passed to another +process that does know the derived type). For this reason, vstructs +should generally not be used to pass large chunks of data. + +Likewise, object handles must be preserved even if they are only +referenced in an unknown-type portion of the vstruct. To facilitate +this, all handles referenced from the vstruct must be contiguous in +the objlist (even if this means duplications), and there must be an +area in the vstruct blob where unmarshalling code can copy the +translated objlist. + +The introspection object reference at the beginning of the vstruct +objlist may be NULL. + Op1: Get Interface List -----------------------