mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 14:26:11 +00:00
Allow allocate in user-space with malloc
This commit is contained in:
parent
d93763ac44
commit
5e28fe83c2
5
types.h
5
types.h
@ -96,6 +96,11 @@ typedef __u64 uint64_t;
|
|||||||
#define NETBUF_ALLOC(buf, buf_len) __u8* buf = kmalloc(buf_len, GFP_ATOMIC);
|
#define NETBUF_ALLOC(buf, buf_len) __u8* buf = kmalloc(buf_len, GFP_ATOMIC);
|
||||||
#define NETBUF_CHECK(buf) ((buf) != NULL)
|
#define NETBUF_CHECK(buf) ((buf) != NULL)
|
||||||
#define NETBUF_FREE(buf) kfree(buf);
|
#define NETBUF_FREE(buf) kfree(buf);
|
||||||
|
#elif defined(ALLOC_MALLOC)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#define NETBUF_ALLOC(buf, buf_len) __u8* buf = malloc(buf_len);
|
||||||
|
#define NETBUF_CHECK(buf) ((buf) != NULL)
|
||||||
|
#define NETBUF_FREE(buf) free(buf);
|
||||||
#else
|
#else
|
||||||
#define NETBUF_ALLOC(buf, buf_len) __u8 buf[buf_len];
|
#define NETBUF_ALLOC(buf, buf_len) __u8 buf[buf_len];
|
||||||
#define NETBUF_CHECK(buf) (1)
|
#define NETBUF_CHECK(buf) (1)
|
||||||
|
Loading…
Reference in New Issue
Block a user