Branch: Tag:

2012-02-09

2012-02-09 13:29:47 by Arne Goedeke <el@laramies.com>

fixed inline -> INLINE

19:   #endif   PMOD_EXPORT char errbuf[8192];    - static inline void ba_htable_insert(const struct block_allocator * a, + static INLINE void ba_htable_insert(const struct block_allocator * a,    const void * ptr, const ba_page_t n);      #define BA_NBLOCK(a, p, ptr) ((uintptr_t)((char*)ptr - (p)->data)/(a)->block_size)
39:   # define PIKE_MEM_RW_RANGE(x, y)   #endif    - static inline void ba_realloc(struct block_allocator * a) { + static INLINE void ba_realloc(struct block_allocator * a) {    unsigned int i;    ba_page old;    ba_page p;
89:    }   }    - PMOD_EXPORT inline void ba_init(struct block_allocator * a, + PMOD_EXPORT INLINE void ba_init(struct block_allocator * a,    uint32_t block_size, ba_page_t blocks) {    uint32_t page_size = block_size * blocks;   
113:    ba_realloc(a);   }    - PMOD_EXPORT inline void ba_free_all(struct block_allocator * a) { + PMOD_EXPORT INLINE void ba_free_all(struct block_allocator * a) {    unsigned int i;       if (!a->allocated) return;
134:    );   }    - PMOD_EXPORT inline void ba_count_all(struct block_allocator * a, size_t *num, size_t *size) { + PMOD_EXPORT INLINE void ba_count_all(struct block_allocator * a, size_t *num, size_t *size) {    unsigned int i;    size_t n = 0;   
147:    *num = n;   }    - PMOD_EXPORT inline void ba_destroy(struct block_allocator * a) { + PMOD_EXPORT INLINE void ba_destroy(struct block_allocator * a) {    ba_free_all(a);    PIKE_MEM_RW_RANGE(a->pages, BA_BYTES(a));    free(a->pages);
156:    a->pages = NULL;   }    - static inline void ba_grow(struct block_allocator * a) { + static INLINE void ba_grow(struct block_allocator * a) {    if (a->allocated) {    // try to detect 32bit overrun?    if (a->allocated >= ((ba_page_t)1 << (sizeof(ba_page_t)*8-1))) {
172:   #endif   }    - static inline void ba_shrink(struct block_allocator * a) { + static INLINE void ba_shrink(struct block_allocator * a) {    a->allocated /= 2;    ba_realloc(a);   }
182:    t ^= (t >> 7) ^ (t >> 4); \   } while(0)    - static inline ba_page_t hash1(const struct block_allocator * a, + static INLINE ba_page_t hash1(const struct block_allocator * a,    const void * ptr) {    uintptr_t t = ((uintptr_t)ptr) >> a->magnitude;   
191:    return (ba_page_t) t;   }    - static inline ba_page_t hash2(const struct block_allocator * a, + static INLINE ba_page_t hash2(const struct block_allocator * a,    const void * ptr) {    uintptr_t t = ((uintptr_t)ptr) >> a->magnitude;   
234:    * insert the pointer to an allocated page into the    * hashtable. uses linear probing and open allocation.    */ - static inline void ba_htable_insert(const struct block_allocator * a, + static INLINE void ba_htable_insert(const struct block_allocator * a,    const void * ptr, const ba_page_t n) {    ba_page_t hval = hash1(a, ptr);    ba_page_t * b = a->htable + (hval & BA_HASH_MASK(a));
263:   }       - static inline void ba_htable_replace(const struct block_allocator * a, + static INLINE void ba_htable_replace(const struct block_allocator * a,    const void * ptr, const ba_page_t n,    const ba_page_t new) {    ba_page_t hval = hash1(a, ptr);
287:   #endif   }    - static inline void ba_htable_delete(const struct block_allocator * a, + static INLINE void ba_htable_delete(const struct block_allocator * a,    const void * ptr, const ba_page_t n) {    ba_page_t hval = hash1(a, ptr);    ba_page_t * b = a->htable + (hval & BA_HASH_MASK(a));
307:   #endif   }    - static inline ba_page_t ba_htable_lookup(const struct block_allocator * a, + static INLINE ba_page_t ba_htable_lookup(const struct block_allocator * a,    const void * ptr) {   #ifdef BA_DEBUG    int c = 0;
340:   }      #ifdef BA_DEBUG - PMOD_EXPORT inline void ba_check_allocator(struct block_allocator * a, + PMOD_EXPORT INLINE void ba_check_allocator(struct block_allocator * a,    char *fun, char *file, int line) {    unsigned int i = 0;    int bad = 0;
410:   #endif       - PMOD_EXPORT inline void * ba_low_alloc(struct block_allocator * a) { + PMOD_EXPORT INLINE void * ba_low_alloc(struct block_allocator * a) {    //fprintf(stderr, "ba_alloc(%p)\n", a);    ba_page p;   #ifdef BA_DEBUG
473:    return p->data;   }    - PMOD_EXPORT inline void ba_low_free(struct block_allocator * a, + PMOD_EXPORT INLINE void ba_low_free(struct block_allocator * a,    void * ptr, ba_page p) {   #ifdef BA_DEBUG    ba_check_allocator(a, "ba_low_free", __FILE__, __LINE__);
541:   }       - PMOD_EXPORT inline void ba_remove_page(struct block_allocator * a, + PMOD_EXPORT INLINE void ba_remove_page(struct block_allocator * a,    ba_page_t n) {    ba_page tmp, p;   #ifdef BA_DEBUG