Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 273b958 in mainline


Ignore:
Timestamp:
2010-11-26T11:58:15Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
052f535
Parents:
bf61d3a
Message:

add attribute((malloc)) to relevant functions, which should improve code optimization

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/slab.h

    rbf61d3a r273b958  
    126126extern void slab_cache_destroy(slab_cache_t *);
    127127
    128 extern void * slab_alloc(slab_cache_t *, unsigned int);
     128extern void *slab_alloc(slab_cache_t *, unsigned int)
     129    __attribute__((malloc));
    129130extern void slab_free(slab_cache_t *, void *);
    130131extern size_t slab_reclaim(unsigned int);
     
    138139
    139140/* malloc support */
    140 extern void *malloc(size_t, unsigned int);
     141extern void *malloc(size_t, unsigned int)
     142    __attribute__((malloc));
    141143extern void *realloc(void *, size_t, unsigned int);
    142144extern void free(void *);
  • uspace/lib/c/include/malloc.h

    rbf61d3a r273b958  
    4141extern uintptr_t get_max_heap_addr(void);
    4242
    43 extern void *malloc(const size_t size);
    44 extern void *calloc(const size_t nmemb, const size_t size);
    45 extern void *memalign(const size_t align, const size_t size);
     43extern void *malloc(const size_t size)
     44    __attribute__((malloc));
     45extern void *calloc(const size_t nmemb, const size_t size)
     46    __attribute__((malloc));
     47extern void *memalign(const size_t align, const size_t size)
     48    __attribute__((malloc));
    4649extern void *realloc(const void *addr, const size_t size);
    4750extern void free(const void *addr);
Note: See TracChangeset for help on using the changeset viewer.