mempool.c: renamed from pool.c

To avoid confusion with pools in irep, we renamed region-based memory
manager from pool to mempool.

- rename pool.c to mempool.c
- separate mempool.h
- rename all mrb_pool to mrb_mempool

So if someone is using pool.c functions (I suppose no one does though),
they need to rename all `mrb_pool` to `mrb_mempool` and include
`mruby/mempool.h` header at the top.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-10-29 11:11:52 +09:00
parent 62ef5db13e
commit 49525fa207
6 changed files with 55 additions and 47 deletions
+2 -1
View File
@@ -8,6 +8,7 @@
#define MRUBY_COMPILE_H
#include "common.h"
#include "mruby/mempool.h"
/**
* mruby Compiler
@@ -122,7 +123,7 @@ struct mrb_parser_heredoc_info {
/* parser structure */
struct mrb_parser_state {
mrb_state *mrb;
struct mrb_pool *pool;
struct mrb_mempool *pool;
mrb_ast_node *cells;
const char *s, *send;
#ifndef MRB_NO_STDIO
+13
View File
@@ -0,0 +1,13 @@
/*
** mempool.h - memory pool
**
** See Copyright Notice in mruby.h
*/
/* memory pool implementation */
typedef struct mrb_mempool mrb_mempool;
MRB_API struct mrb_mempool* mrb_mempool_open(mrb_state*);
MRB_API void mrb_mempool_close(struct mrb_mempool*);
MRB_API void* mrb_mempool_alloc(struct mrb_mempool*, size_t);
MRB_API void* mrb_mempool_realloc(struct mrb_mempool*, void*, size_t oldlen, size_t newlen);
MRB_API mrb_bool mrb_mempool_can_realloc(struct mrb_mempool*, void*, size_t);