[Csci551-talk] KILL THE MARSHALL (unmarshall him) hawhaw

John Heidemann johnh at ISI.EDU
Wed Mar 24 18:15:38 PST 2004


On Tue, 23 Mar 2004 12:33:52 PST, pritam baruah wrote: 
>
>Someone asked about marshalling/unmarshalling. There is no need to do it if the 
>compiler is instructed a-priori not to insert padding on word boundaries within 
>structures. Another way is manually inserting a dummy 8 bit field after the 
>"type" field and a dummy 16 bit field after the "number of links" field. These 
>are little hacks so you should use them at your own peril. Beware :- Dummy 
>fields require cognizance of endianness of the processor architecture. You can 
>use preprocessor macros to selectively produce "endian" adjusted compiler 
>inputs.

Let me be explicit:

For this project, you WILL NEED to use marshalling.

You're correct that in some cases you can make special requests of the
compiler to avoid padding.  However that is not portable code.  It
will also produce code that runs VERY slowly because the program will
have to pack and unpack those variables ANY time it accesses them.  A
program that manipulates the compiler in this way would not be worth
full credit for this assignment.

But more importantly, if you look at the structure, it has two
variable length fields.  How are you going to handle both of these
with complier tricks?

   -John Heidemann


More information about the Csci551-talk mailing list