mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user