Changeset 2654

Show
Ignore:
Timestamp:
07/19/99 02:02:02 (15 years ago)
Author:
ucacoxh
Message:

Added pb_node_count. A function that got added when memory hole hunting
a while back.

Location:
rat/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/playout.c

    r2587 r2654  
    202202{ 
    203203        return (pb->psentinel->next == pb->psentinel); 
     204} 
     205 
     206u_int32 
     207pb_node_count(pb_t *pb) 
     208{ 
     209#ifndef NDEBUG 
     210        pb_node_t *stop, *curr; 
     211        u_int32 cnt = 0; 
     212        stop = pb->psentinel; 
     213        curr = pb->psentinel->prev; 
     214        while (curr != stop) { 
     215                cnt++; 
     216                curr = curr->prev; 
     217        } 
     218        assert(pb->n_nodes == cnt); 
     219#endif /* NDEBUG */ 
     220        return pb->n_nodes; 
    204221} 
    205222 
  • rat/trunk/playout.h

    r2587 r2654  
    2020struct  s_pb_iterator; 
    2121 
    22 typedef void (*playoutfreeproc)(u_char**, u_int32); 
     22typedef void (*playoutfreeproc)(u_char** memblk, u_int32 blksize); 
    2323 
    2424/* All functions return TRUE on success, and FALSE on failure */ 
     
    3636 
    3737int  pb_is_empty (struct s_pb *pb); 
     38 
     39/* pb_node_count is a debugging function to count (and verify) how 
     40 * many nodes are used in a given playout buffer. 
     41 */ 
     42u_int32 pb_node_count (struct s_pb *pb); 
    3843 
    3944void pb_shift_back(struct s_pb *pb, ts_t delta);