@@ -37,29 +37,13 @@
#define __hot __attribute__((__hot__))
#define __cold __attribute__((__cold__))
+#ifdef CONFIG_NOLIBC
void *__uring_memset(void *s, int c, size_t n);
void *__uring_malloc(size_t len);
void __uring_free(void *p);
-static inline void *uring_malloc(size_t len)
-{
-#ifdef CONFIG_NOLIBC
- return __uring_malloc(len);
-#else
- return malloc(len);
-#endif
-}
-
-static inline void uring_free(void *ptr)
-{
-#ifdef CONFIG_NOLIBC
- __uring_free(ptr);
-#else
- free(ptr);
-#endif
-}
-
-#ifdef CONFIG_NOLIBC
+#define malloc(LEN) __uring_malloc(LEN)
+#define free(PTR) __uring_free(PTR)
#define memset(PTR, C, LEN) __uring_memset(PTR, C, LEN)
#endif
@@ -215,7 +215,7 @@ __cold struct io_uring_probe *io_uring_get_probe_ring(struct io_uring *ring)
int r;
len = sizeof(*probe) + 256 * sizeof(struct io_uring_probe_op);
- probe = uring_malloc(len);
+ probe = malloc(len);
if (!probe)
return NULL;
memset(probe, 0, len);
@@ -224,7 +224,7 @@ __cold struct io_uring_probe *io_uring_get_probe_ring(struct io_uring *ring)
if (r >= 0)
return probe;
- uring_free(probe);
+ free(probe);
return NULL;
}
@@ -245,7 +245,7 @@ __cold struct io_uring_probe *io_uring_get_probe(void)
__cold void io_uring_free_probe(struct io_uring_probe *probe)
{
- uring_free(probe);
+ free(probe);
}
static inline int __fls(unsigned long x)