There are 11 pointers, so on a 64-bit machine, we copy 88 bytes.

I'm not really worried about execution time on a little-used function like 
OCSetPlatformInfo.  I concerned about reactions similar to Gabriel's, where 
people evaluating our API think we're ignorant and judge the stack.

John

-----Original Message-----
From: iotivity-dev-bounces at lists.iotivity.org 
[mailto:[email protected]] On Behalf Of Thiago Macieira
Sent: Wednesday, September 30, 2015 11:52 AM
To: iotivity-dev at lists.iotivity.org
Subject: Re: [dev] OCPlatformInfo passed by value

On Wednesday 30 September 2015 20:41:44 Schulhof, Gabriel wrote:
> Hey!
> 
> Big +1 from me. Seeing a structure passed by value is just ... ugh.

Depending on the size, it's acceptable. The rule of thumb is 16 bytes.

See http://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/

(I've been asked to write "the reference on passing by reference" and "pointers 
on passing by pointer", but never got around to it)
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
iotivity-dev mailing list
iotivity-dev at lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to