aboutsummaryrefslogtreecommitdiff
path: root/src/libc/include/stdlib.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-11-12 00:37:26 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2025-11-16 22:57:45 +0100
commit2ce58c995946f85666e793c4f06efff683e76ae4 (patch)
treefbf2658bb0b0f61dadcf4ca27f997eaded78aae5 /src/libc/include/stdlib.h
parent5ce25ae3b5d8666d373f7d7e336546ce8508c213 (diff)
Diffstat (limited to 'src/libc/include/stdlib.h')
-rw-r--r--src/libc/include/stdlib.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/libc/include/stdlib.h b/src/libc/include/stdlib.h
index 2704fca..b6e092e 100644
--- a/src/libc/include/stdlib.h
+++ b/src/libc/include/stdlib.h
@@ -57,10 +57,10 @@ div_t div(int __numerator, int __denominator);
#define RESET "\x1b[0m"
#define malloc(__n) ({void *__p; \
+ int Printf(const char *, ...); \
Printf(GREEN "-> %s:%d (%s)", __FILE__, __LINE__, __func__); \
__p = __malloc(__n); \
Printf(", p=%p" RESET "\n", __p); \
- int Printf(const char *, ...); \
size_t ta_num_free(); \
size_t ta_num_used(); \
size_t ta_num_fresh(); \
@@ -71,13 +71,13 @@ div_t div(int __numerator, int __denominator);
__p;})
#define realloc(__p, __n) ({void *__np; \
+ int Printf(const char *, ...); \
+ size_t ta_num_free(); \
+ size_t ta_num_used(); \
+ size_t ta_num_fresh(); \
Printf(YELLOW "-> %s:%d (%s)", __FILE__, __LINE__, __func__); \
__np = __realloc(__p, __n); \
Printf(", np=%p" RESET "\n", __np); \
- int Printf(const char *, ...); \
- size_t ta_num_free(); \
-size_t ta_num_used(); \
-size_t ta_num_fresh(); \
Printf("%s: free=%lu, used=%lu, fresh=%lu\n", __func__, \
(unsigned long)ta_num_free(), \
(unsigned long)ta_num_used(), \
@@ -85,13 +85,13 @@ size_t ta_num_fresh(); \
__np;})
#define calloc(__n, __sz) ({void *__p; \
+ int Printf(const char *, ...); \
+ size_t ta_num_free(); \
+ size_t ta_num_used(); \
+ size_t ta_num_fresh(); \
Printf(YELLOW "-> %s:%d (%s)", __FILE__, __LINE__, __func__); \
__p = __calloc(__n, __sz); \
Printf(", p=%p" RESET "\n", __p); \
- int Printf(const char *, ...); \
- size_t ta_num_free(); \
-size_t ta_num_used(); \
-size_t ta_num_fresh(); \
Printf("%s: free=%lu, used=%lu, fresh=%lu\n", __func__, \
(unsigned long)ta_num_free(), \
(unsigned long)ta_num_used(), \
@@ -100,18 +100,18 @@ size_t ta_num_fresh(); \
#define free(__p) ({ \
int Printf(const char *, ...); \
+ size_t ta_num_free(); \
+ size_t ta_num_used(); \
+ size_t ta_num_fresh(); \
Printf(RED "<- %s:%d (%s), p=%p" RESET "\n", \
__FILE__, __LINE__, __func__, __p); \
- size_t ta_num_free(); \
- size_t ta_num_used(); \
- size_t ta_num_fresh(); \
- __free(__p);\
- Printf("%s: free=%lu, used=%lu, fresh=%lu\n", \
- __func__, \
- (unsigned long)ta_num_free(), \
- (unsigned long)ta_num_used(), \
- (unsigned long)ta_num_fresh()); \
- })
+ __free(__p);\
+ Printf("%s: free=%lu, used=%lu, fresh=%lu\n", \
+ __func__, \
+ (unsigned long)ta_num_free(), \
+ (unsigned long)ta_num_used(), \
+ (unsigned long)ta_num_fresh()); \
+ })
#endif
#endif