Changeset 149 for trunk/include/slib.h


Ignore:
Timestamp:
Jan 7, 2008, 8:52:13 PM (17 years ago)
Author:
katerina
Message:

Make sh_hash.c thread-safe, remove plenty of tiny allocations, improve sh_mem_dump, modify port check to run as thread, and fix unsetting of sh_thread_pause_flag (was too early).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/slib.h

    r138 r149  
    6363#define SH_PWBUF_SIZE  4096
    6464
     65
     66#if defined(__GNUC__) && (__GNUC__ >= 3)
     67#undef  SL_GNUC_CONST
     68#define SL_GNUC_CONST   __attribute__((const))
     69#else
     70#undef  SH_GNUC_CONST
     71#define SH_GNUC_CONST
     72#endif
    6573
    6674/*
     
    405413  /* Overflow tests
    406414   */
    407   int sl_ok_muli (int a, int b);
    408   int sl_ok_divi (int a, int b);
    409   int sl_ok_addi (int a, int b);
    410   int sl_ok_subi (int a, int b);
    411 
    412   int sl_ok_muls (size_t a, size_t b);
    413   int sl_ok_adds (size_t a, size_t b);
     415  int sl_ok_muli (int a, int b) SL_GNUC_CONST;
     416  int sl_ok_divi (int a, int b) SL_GNUC_CONST;
     417  int sl_ok_addi (int a, int b) SL_GNUC_CONST;
     418  int sl_ok_subi (int a, int b) SL_GNUC_CONST;
     419
     420  int sl_ok_muls (size_t a, size_t b) SL_GNUC_CONST;
     421  int sl_ok_adds (size_t a, size_t b) SL_GNUC_CONST;
    414422
    415423
Note: See TracChangeset for help on using the changeset viewer.