This commit is contained in:
Antonio SJ Musumeci 2025-10-26 14:53:46 -05:00
parent 95e62e6a98
commit e9bfa96f26
21 changed files with 293 additions and 708 deletions

36
libfuse/lib/fuse_req.cpp Normal file
View file

@ -0,0 +1,36 @@
#include "fuse_req.hpp"
#include <cstddef>
#include <cstdlib>
typedef struct stack_t stack_t;
struct stack_t
{
stack_t *next;
};
thread_local static stack_t *g_stack = NULL;
fuse_req_t*
fuse_req_alloc()
{
if(g_stack == NULL)
return (fuse_req_t*)calloc(1,sizeof(fuse_req_t));
fuse_req_t *req;
req = (fuse_req_t*)g_stack;
g_stack = g_stack->next;
return req;
}
void
fuse_req_free(fuse_req_t *req_)
{
stack_t *stack;
stack = (stack_t*)req_;
stack->next = g_stack;
g_stack = stack;
}