瀏覽代碼

use malloc attribute

tags/v0.9.3
Holger Lubitz 17 年之前
父節點
當前提交
6f61e254dc
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      src/include/stdlib.h

+ 3
- 3
src/include/stdlib.h 查看文件

@@ -20,10 +20,10 @@ extern unsigned long strtoul ( const char *p, char **endp, int base );
20 20
  ****************************************************************************
21 21
  */
22 22
 
23
-extern void * malloc ( size_t size );
23
+extern void * __malloc malloc ( size_t size );
24 24
 extern void * realloc ( void *old_ptr, size_t new_size );
25 25
 extern void free ( void *ptr );
26
-extern void * zalloc ( size_t len );
26
+extern void * __malloc zalloc ( size_t len );
27 27
 
28 28
 /**
29 29
  * Allocate cleared memory
@@ -38,7 +38,7 @@ extern void * zalloc ( size_t len );
38 38
  * function in zalloc(), since in most cases @c nmemb will be 1 and
39 39
  * doing the multiply is just wasteful.
40 40
  */
41
-static inline void * calloc ( size_t nmemb, size_t size ) {
41
+static inline void * __malloc calloc ( size_t nmemb, size_t size ) {
42 42
 	return zalloc ( nmemb * size );
43 43
 }
44 44
 

Loading…
取消
儲存