tmf.core: fix timestamp normalization clamping
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Sun, 28 Feb 2016 14:57:34 +0000 (09:57 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 4 Mar 2016 01:10:37 +0000 (20:10 -0500)
commit9e92552251e9a4de7793c0681b5489da0bcef9cc
treecb32ccceec03b938445e78873eb423cb5b63f516
parent5cca8cafb564468f39023a5057d7e066cd8b4922
tmf.core: fix timestamp normalization clamping

This patch fixes a behavior issue with timestamps. Offsetting and
normalizing timestamps no longer overflows, nor does it throw
arithmetic exceptions.

This is done by using a saturated add and mult method from TmfTimestamp.
The saturated math should have a negligeable impact on performance.

Change-Id: I8f6fc7fc930586897923bb8510574ec4c4c668b3
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/67501
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimestampTest.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfNanoTimestamp.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfSimpleTimestamp.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimestamp.java
This page took 0.026211 seconds and 5 git commands to generate.