Changeset 2479 for trunk


Ignore:
Timestamp:
Oct 18, 2012, 4:39:38 PM (6 years ago)
Author:
lindanl
Message:

Change to static functions.

Location:
trunk/lib/perflib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/perflib/BOM_Profiler.h

    r2286 r2479  
    5555typedef struct BOM_Table BOM_Table;
    5656
    57 BOM_Table * init_BOM_timer () {
     57static inline BOM_Table * init_BOM_timer () {
    5858  BOM_Table * timer_table = (BOM_Table *) malloc(sizeof(BOM_Table));
    5959  if (!timer_table) {
     
    9090#define SEQ_TIMESTAMP_COUNT 8
    9191
    92 void dump_BOM_table(BOM_Table * timer_table) {
     92static void dump_BOM_table(BOM_Table * timer_table) {
    9393  // an array of counts and timings per binary order of magnitude
    9494  int BOM_count[BIT_COUNT];
     
    182182}
    183183
    184 void destroy_BOM_timer(BOM_Table * timer_table) {
     184static inline void destroy_BOM_timer(BOM_Table * timer_table) {
    185185        if(timer_table) {
    186186                free(timer_table);
  • trunk/lib/perflib/WallTime.h

    r2275 r2479  
    5858typedef struct Timer_Table Timer_Table;
    5959
    60 Timer_Table * init_Wall_timer () {
     60static inline Timer_Table * init_Wall_timer () {
    6161  Timer_Table * timer_table = (Timer_Table *) malloc(sizeof(Timer_Table));
    6262  if (!timer_table) {
     
    9393
    9494
    95 void dump_Timer_Table(Timer_Table * timer_table) {
     95static void dump_Timer_Table(Timer_Table * timer_table) {
    9696  // an array of counts and timings per binary order of magnitude
    9797  int Wall_count[BIT_COUNT];
     
    154154}
    155155
    156 void destroy_Wall_timer(Timer_Table * timer_table) {
     156static inline void destroy_Wall_timer(Timer_Table * timer_table) {
    157157        if(timer_table) {
    158158                free(timer_table);
  • trunk/lib/perflib/perfsec.h

    r2275 r2479  
    1515  #include <sched.h>
    1616
    17   int set_processor_affinity(unsigned long mask) { // mask = 1 sets hard processor affinity for core 1, mask = 2 for core 2, mask = 4 for core 3, mask = 7 for core 1 and core 2 and core 3.
     17  static inline int set_processor_affinity(unsigned long mask) { // mask = 1 sets hard processor affinity for core 1, mask = 2 for core 2, mask = 4 for core 3, mask = 7 for core 1 and core 2 and core 3.
    1818
    1919    unsigned int len = sizeof(mask);
     
    3535  #define getpid _getpid
    3636
    37   int set_processor_affinity(DWORD_PTR mask) {
     37  static inline int set_processor_affinity(DWORD_PTR mask) {
    3838
    3939    HANDLE hProcess  = OpenProcess(PROCESS_ALL_ACCESS, 0, getpid());
     
    5151#else
    5252
    53   int set_processor_affinity(unsigned long mask) {
     53  inline int set_processor_affinity(unsigned long mask) {
    5454        printf("set_processor_affinity is not implemented on the current OS.\n");
    5555        return -1;
Note: See TracChangeset for help on using the changeset viewer.