Per,
In my opinion the implementation must not be able to assume
that the information will remain persistent - therefore it should
copy.
Once the call is made the application should be free to destroy
the info.
In many of our examples we do just that. The information passed
to the ::Bind??Port calls is stored in an automatic variable which
subsequently goes out of scope once the port initializaion ops
complete.
-- johnS
Bojsen, Per wrote:
> Hi,
>
> this is a minor issue, but it does affect SCE-MI implementation. The
> SceMi::BindMessageInPort() and SceMi::BindMessageOutPort() methods each
> take a binding argument that is a pointer to a struct the user has
> defined. Is the implementation required to copy the contents of this
> struct (if the pointer is not NULL) internally? The answer to this
> question affects what the application can do with the struct after
> calling one of these methods. If the answer is yes, the application can
> do whatever it wants with the struct. If the answer is no, then the
> application must keep the struct around until Shutdown() time.
> Furthermore,
> is must potentially keep track of multiple of these structs (in the worst
> case one per port if none of them can be shared). Also, if the answer
> is no, this raises several other questions such as will the application
> be allowed to change the fields of the binding structs while the emulation
> is running.
>
> My take on these is that the implementation should be required to copy
> the contents of the binding argument. This places the least constraints
> on the application and avoids some potentially nasty problems if the
> application accidentally changed one or more fields of the struct while
> the emulation is running. If it actually wants to change these fields
> it can use the ReplaceBinding() method.
>
> If the committee agrees, I propose we add a sentence to the description
> of each of the BindMessage(In|Out)Port() methods that states that the
> implementation is required to copy the contents of the binding struct
> and the application is free to discard of the struct after the call.
>
> Per
>
-- This email may contain material that is confidential, privileged and/or attorney work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission /\ is strictly prohibited. If you are /\ | \ not the intended recipient please | \ / | contact the sender and delete / \ \ all copies. /\_/ K2 \_ \_ ______________________________/\/ \ \ John Stickley \ \ \ Principal Engineer \ \________________ Mentor Graphics - MED \_ 17 E. Cedar Place \ john_stickley@mentor.com Ramsey, NJ 07446 \ Phone: (201) 818-2585 ________________________________________________________________Received on Wed Mar 17 08:22:52 2004
This archive was generated by hypermail 2.1.8 : Wed Mar 17 2004 - 08:22:53 PST