Hi,

This is bu5hman's idea mostly, but I'd like to bring the question to the
attention of everyone, as I had the same idea before.

For simple structs (think Eina.Rectangle, and Efl.Gfx.Color), would it be
acceptable to pass them by value instead of reference, in C?
That is:

Eina_Rectangle a = {1, 2, 3, 4};
rect_set(obj, rect);
Eina_Rectangle b = rect_get(obj);

Or even (non portable way, but applications could feel free to use this):
rect_set(obj, (Eina_Rectangle){.w = 13, .h = 37});


I understand this could simplify some code.


My main problem with it is a concern about ABI compatibility. It seems GCC
itself has various ways to pass structs by value. See:
http://stackoverflow.com/questions/161788/are-there-any-downsides-to-passing-structs-by-value-in-c-rather-than-passing-a


Does anyone have real-life knowledge about this? How is it on Windows?
Any strong arguments in favor or against?


-- 
Jean-Philippe André
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to