[Tinyos-devel] call-by-value vs. -pointer
Philip Levis
pal at cs.stanford.edu
Fri Jun 13 09:16:27 PDT 2008
On Jun 13, 2008, at 1:47 AM, Jan Hauer wrote:
> In my situation the call is split-phase (request->confirm), and with
> the standard TinyOS semantics the caller would have to guarantee that
> the pointer is valid until the confirm event. But in contrast to the
> Send interface, the caller is not interested in getting the parameters
> back, because they carry only control information for this particular
> call (e.g. address/status information). What the caller actually wants
> is call-by-value semantics - but the list of arguments is long...
> Forcing the caller to guarantee that these parameters are valid until
> the confirm event means that the caller must allocate them as global
> (module) variables. And, because the caller can have multiple
> outstanding requests it would even have to allocate multiple parameter
> sets.
Somebody has to allocate the state, whether it's the caller, passed by
a pointer, or the callee, passed by value and stored into a structure.
Phil
More information about the Tinyos-devel
mailing list