Changeset 1002

Show
Ignore:
Timestamp:
04/20/08 04:06:26 (13 years ago)
Author:
ppalmers
Message:

small optimization

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libieee1394/CycleTimerHelper.cpp

    r982 r1002  
    561561{ 
    562562    uint32_t retval; 
    563     struct compute_vars my_vars; 
     563    struct compute_vars *my_vars; 
    564564 
    565565    // get pointer and copy the contents 
    566566    // no locking should be needed since we have more than one 
    567     // of these vars available, and the copy will always be finished before 
     567    // of these vars available, and our use will always be finished before 
    568568    // m_current_shadow_idx changes since this thread's priority should 
    569569    // be higher than the one of the writer thread. Even if not, we only have to ensure 
    570570    // that the used dataset is consistent. We can use an older dataset if it's consistent 
    571571    // since it will also provide a fairly decent extrapolation. 
    572     unsigned int curr_idx = m_current_shadow_idx; // NOTE: this needs ordering 
    573     my_vars = m_shadow_vars[curr_idx]; 
    574  
    575     int64_t time_diff = now - my_vars.usecs; 
    576     double y_step_in_ticks = ((double)time_diff) * my_vars.rate; 
     572    my_vars = m_shadow_vars + m_current_shadow_idx; 
     573 
     574    int64_t time_diff = now - my_vars->usecs; 
     575    double y_step_in_ticks = ((double)time_diff) * my_vars->rate; 
    577576    int64_t y_step_in_ticks_int = (int64_t)y_step_in_ticks; 
    578     uint64_t offset_in_ticks_int = my_vars.ticks; 
     577    uint64_t offset_in_ticks_int = my_vars->ticks; 
    579578 
    580579    if (y_step_in_ticks_int > 0) {