On 17.05.16 13:23, Elo, Matias (Nokia - FI/Espoo) wrote:
Hi Matias,
The odp_time_local and others functions are time sensitive functions,
that's why it was decided to avoid copping as more as possible.
The timespec is not simple "long type". Its type is arch dependent but is always
64bit.
In case of 32 bit system it's defined as long long.
The same for odp_time_t struct. So, at least for now it seems to be the same for
both 32 and 64 bit systems.
Hi Ivan,
At least for 32/64-bit Ubuntu this is not the case. On a 32-bit system (Ubuntu
16.04) the size of struct timespec is 8 bytes (type is long int) and on a
64-bit system it is 16 bytes. The validation tests were failing before this
patch on a 32-bit system.
It's nice to see it captured by val tests, that was expected.
When it comes to the performance, I wouldn't believe this patch having much of
an impact. It's an inline function and the compiler should be able to optimize
out the added copy operations.
That's not always true. At least in case of "32/64" issue in question and when
optimization is disabled.
The types are different, then better to make odp_time_t to be same size of
timespec.
Initially, it was smth like typedef timespec odp_time_t, but new versions of
Ubuntu
have some problem with leaking some library internals to ODP project with such
definition
(not sure what it was, I'm using 14.04).
Maybe better to align the size of odp_time_t struct with timespec ...?
-Matias
And I think Bill Fischofer knew about this while adding
this
,at first glance, strange union, right Bill?
Yes, it's not the best decision from style point of view, but it's fast and in
case of
an error
is supposed to be caught by time validation tests.
--
Regards,
Ivan Khoronzhuk
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp