diff --git a/jerry-core/ecma/base/ecma-alloc.c b/jerry-core/ecma/base/ecma-alloc.c index c5c37fded..dae9f6ad4 100644 --- a/jerry-core/ecma/base/ecma-alloc.c +++ b/jerry-core/ecma/base/ecma-alloc.c @@ -18,7 +18,7 @@ #include "ecma-gc.h" #include "ecma-lcache.h" #include "jrt.h" -#include "jmem-poolman.h" +#include "jmem.h" JERRY_STATIC_ASSERT (sizeof (ecma_property_value_t) == sizeof (ecma_value_t), size_of_ecma_property_value_t_must_be_equal_to_size_of_ecma_value_t); diff --git a/jerry-core/ecma/base/ecma-gc.h b/jerry-core/ecma/base/ecma-gc.h index 2a6010841..f50c88864 100644 --- a/jerry-core/ecma/base/ecma-gc.h +++ b/jerry-core/ecma/base/ecma-gc.h @@ -17,7 +17,7 @@ #define ECMA_GC_H #include "ecma-globals.h" -#include "jmem-allocator.h" +#include "jmem.h" /** \addtogroup ecma ECMA * @{ diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index 0a4c21671..4eef30767 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -19,7 +19,7 @@ #include "config.h" #include "jrt.h" #include "lit-magic-strings.h" -#include "jmem-allocator.h" +#include "jmem.h" /** \addtogroup ecma ECMA * @{ @@ -38,7 +38,11 @@ * The offset is shifted right by JMEM_ALIGNMENT_LOG. * Least significant JMEM_ALIGNMENT_LOG bits of non-shifted offset are zeroes. */ -#define ECMA_POINTER_FIELD_WIDTH JMEM_CP_WIDTH +#ifdef JERRY_CPOINTER_32_BIT +#define ECMA_POINTER_FIELD_WIDTH 32 +#else /* !JERRY_CPOINTER_32_BIT */ +#define ECMA_POINTER_FIELD_WIDTH 16 +#endif /* JERRY_CPOINTER_32_BIT */ /** * The NULL value for compressed pointers diff --git a/jerry-core/ecma/base/ecma-helpers.h b/jerry-core/ecma/base/ecma-helpers.h index dc134dc03..e86222548 100644 --- a/jerry-core/ecma/base/ecma-helpers.h +++ b/jerry-core/ecma/base/ecma-helpers.h @@ -17,7 +17,7 @@ #define ECMA_HELPERS_H #include "ecma-globals.h" -#include "jmem-allocator.h" +#include "jmem.h" #include "lit-strings.h" /** \addtogroup ecma ECMA diff --git a/jerry-core/ecma/base/ecma-init-finalize.c b/jerry-core/ecma/base/ecma-init-finalize.c index 42c3f51eb..fc2ba709b 100644 --- a/jerry-core/ecma/base/ecma-init-finalize.c +++ b/jerry-core/ecma/base/ecma-init-finalize.c @@ -20,7 +20,7 @@ #include "ecma-lcache.h" #include "ecma-lex-env.h" #include "ecma-literal-storage.h" -#include "jmem-allocator.h" +#include "jmem.h" #include "jcontext.h" /** \addtogroup ecma ECMA diff --git a/jerry-core/ecma/base/ecma-literal-storage.h b/jerry-core/ecma/base/ecma-literal-storage.h index 2ea398a03..67310133a 100644 --- a/jerry-core/ecma/base/ecma-literal-storage.h +++ b/jerry-core/ecma/base/ecma-literal-storage.h @@ -17,7 +17,7 @@ #define ECMA_LIT_STORAGE_H #include "ecma-globals.h" -#include "jmem-allocator.h" +#include "jmem.h" #include "lit-globals.h" /** \addtogroup ecma ECMA diff --git a/jerry-core/jcontext/jcontext.h b/jerry-core/jcontext/jcontext.h index 3cd4c31db..b9acd4a98 100644 --- a/jerry-core/jcontext/jcontext.h +++ b/jerry-core/jcontext/jcontext.h @@ -20,8 +20,7 @@ #define JCONTEXT_H #include "ecma-builtins.h" -#include "jmem-allocator.h" -#include "jmem-config.h" +#include "jmem.h" #include "re-bytecode.h" #include "vm-defines.h" diff --git a/jerry-core/jmem/jmem-allocator-internal.h b/jerry-core/jmem/jmem-allocator-internal.h index 398900a59..a76b1672b 100644 --- a/jerry-core/jmem/jmem-allocator-internal.h +++ b/jerry-core/jmem/jmem-allocator-internal.h @@ -24,9 +24,33 @@ * @{ */ +#ifdef JMEM_STATS +void jmem_heap_get_stats (jmem_heap_stats_t *); +void jmem_heap_stats_reset_peak (void); +void jmem_heap_stats_print (void); +#endif /* JMEM_STATS */ + +void jmem_heap_init (void); +void jmem_heap_finalize (void); +bool jmem_is_heap_pointer (const void *pointer); + void jmem_run_free_unused_memory_callbacks (jmem_free_unused_memory_severity_t severity); /** + * \addtogroup poolman Memory pool manager + * @{ + */ +#ifdef JMEM_STATS +void jmem_pools_get_stats (jmem_pools_stats_t *); +void jmem_pools_stats_reset_peak (void); +void jmem_pools_stats_print (void); +#endif /* JMEM_STATS */ + +void jmem_pools_finalize (void); +void jmem_pools_collect_empty (void); + +/** + * @} * @} */ diff --git a/jerry-core/jmem/jmem-allocator.c b/jerry-core/jmem/jmem-allocator.c index f0f3b71df..9110693b4 100644 --- a/jerry-core/jmem/jmem-allocator.c +++ b/jerry-core/jmem/jmem-allocator.c @@ -18,9 +18,7 @@ */ #include "jcontext.h" -#include "jmem-allocator.h" -#include "jmem-heap.h" -#include "jmem-poolman.h" +#include "jmem.h" #include "jrt-libc-includes.h" #define JMEM_ALLOCATOR_INTERNAL diff --git a/jerry-core/jmem/jmem-config.h b/jerry-core/jmem/jmem-config.h deleted file mode 100644 index 543ce41e9..000000000 --- a/jerry-core/jmem/jmem-config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef JMEM_CONFIG_H -#define JMEM_CONFIG_H - -#include "config.h" - -/** - * Size of heap - */ -#define JMEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_AREA_SIZE)) - -/** - * Logarithm of required alignment for allocated units/blocks - */ -#define JMEM_ALIGNMENT_LOG 3 - -#endif /* !JMEM_CONFIG_H */ diff --git a/jerry-core/jmem/jmem-heap.c b/jerry-core/jmem/jmem-heap.c index 2c65545ac..2699d70a4 100644 --- a/jerry-core/jmem/jmem-heap.c +++ b/jerry-core/jmem/jmem-heap.c @@ -18,9 +18,7 @@ */ #include "jcontext.h" -#include "jmem-allocator.h" -#include "jmem-config.h" -#include "jmem-heap.h" +#include "jmem.h" #include "jrt-bit-fields.h" #include "jrt-libc-includes.h" @@ -51,15 +49,12 @@ #endif /* JERRY_VALGRIND */ #ifdef JERRY_VALGRIND_FREYA -# include "memcheck.h" -/** - * Called by pool manager before a heap allocation or free. - */ -void jmem_heap_valgrind_freya_mempool_request (void) -{ - JERRY_CONTEXT (valgrind_freya_mempool_request) = true; -} /* jmem_heap_valgrind_freya_mempool_request */ +#ifdef JERRY_VALGRIND +#error Valgrind and valgrind-freya modes are not compatible. +#endif /* JERRY_VALGRIND */ + +#include "memcheck.h" # define VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST \ bool mempool_request = JERRY_CONTEXT (valgrind_freya_mempool_request); \ diff --git a/jerry-core/jmem/jmem-heap.h b/jerry-core/jmem/jmem-heap.h deleted file mode 100644 index 565e8ec65..000000000 --- a/jerry-core/jmem/jmem-heap.h +++ /dev/null @@ -1,121 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Heap allocator interface - */ -#ifndef JMEM_HEAP_H -#define JMEM_HEAP_H - -#include "jrt.h" - -/** \addtogroup mem Memory allocation - * @{ - * - * \addtogroup heap Heap - * @{ - */ - -void jmem_heap_init (void); -void jmem_heap_finalize (void); -void *jmem_heap_alloc_block (const size_t size); -void *jmem_heap_alloc_block_null_on_error (const size_t size); -void jmem_heap_free_block (void *ptr, const size_t size); -bool jmem_is_heap_pointer (const void *pointer); - -#ifdef JMEM_STATS -/** - * Heap memory usage statistics - */ -typedef struct -{ - size_t size; /**< size */ - - size_t allocated_bytes; /**< currently allocated bytes */ - size_t peak_allocated_bytes; /**< peak allocated bytes */ - size_t global_peak_allocated_bytes; /**< non-resettable peak allocated bytes */ - - size_t waste_bytes; /**< bytes waste due to blocks filled partially - and due to block headers */ - size_t peak_waste_bytes; /**< peak bytes waste */ - size_t global_peak_waste_bytes; /**< non-resettable peak bytes waste */ - - size_t skip_count; - size_t nonskip_count; - - size_t alloc_count; - size_t alloc_iter_count; - - size_t free_count; - size_t free_iter_count; -} jmem_heap_stats_t; - -void jmem_heap_get_stats (jmem_heap_stats_t *); -void jmem_heap_stats_reset_peak (void); -void jmem_heap_stats_print (void); -#endif /* JMEM_STATS */ - -#ifdef JERRY_VALGRIND_FREYA - -#ifdef JERRY_VALGRIND -#error Valgrind and valgrind-freya modes are not compatible. -#endif /* JERRY_VALGRIND */ - -void jmem_heap_valgrind_freya_mempool_request (void); - -#define JMEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST() jmem_heap_valgrind_freya_mempool_request () - -#else /* !JERRY_VALGRIND_FREYA */ - -#define JMEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST() - -#endif /* JERRY_VALGRIND_FREYA */ - -/** - * Define a local array variable and allocate memory for the array on the heap. - * - * If requested number of elements is zero, assign NULL to the variable. - * - * Warning: - * if there is not enough memory on the heap, shutdown engine with ERR_OUT_OF_MEMORY. - */ -#define JMEM_DEFINE_LOCAL_ARRAY(var_name, number, type) \ -{ \ - size_t var_name ## ___size = (size_t) (number) * sizeof (type); \ - type *var_name = (type *) (jmem_heap_alloc_block (var_name ## ___size)); - -/** - * Free the previously defined local array variable, freeing corresponding block on the heap, - * if it was allocated (i.e. if the array's size was non-zero). - */ -#define JMEM_FINALIZE_LOCAL_ARRAY(var_name) \ - if (var_name != NULL) \ - { \ - JERRY_ASSERT (var_name ## ___size != 0); \ - \ - jmem_heap_free_block (var_name, var_name ## ___size); \ - } \ - else \ - { \ - JERRY_ASSERT (var_name ## ___size == 0); \ - } \ -} - -/** - * @} - * @} - */ - -#endif /* !JMEM_HEAP_H */ diff --git a/jerry-core/jmem/jmem-poolman.c b/jerry-core/jmem/jmem-poolman.c index cc053f9ae..4ba0c4936 100644 --- a/jerry-core/jmem/jmem-poolman.c +++ b/jerry-core/jmem/jmem-poolman.c @@ -18,9 +18,7 @@ */ #include "jcontext.h" -#include "jmem-allocator.h" -#include "jmem-heap.h" -#include "jmem-poolman.h" +#include "jmem.h" #include "jrt-libc-includes.h" #define JMEM_ALLOCATOR_INTERNAL diff --git a/jerry-core/jmem/jmem-poolman.h b/jerry-core/jmem/jmem-poolman.h deleted file mode 100644 index f502cad44..000000000 --- a/jerry-core/jmem/jmem-poolman.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pool manager interface - */ -#ifndef JMEM_POOLMAN_H -#define JMEM_POOLMAN_H - -#include "jrt.h" - -/** \addtogroup mem Memory allocation - * @{ - * - * \addtogroup poolman Memory pool manager - * @{ - */ - -void jmem_pools_finalize (void); -void *jmem_pools_alloc (size_t size); -void jmem_pools_free (void *chunk_p, size_t size); -void jmem_pools_collect_empty (void); - -#ifdef JMEM_STATS -/** - * Pools' memory usage statistics - */ -typedef struct -{ - /** pools' count */ - size_t pools_count; - - /** peak pools' count */ - size_t peak_pools_count; - - /** non-resettable peak pools' count */ - size_t global_peak_pools_count; - - /** free chunks count */ - size_t free_chunks; - - /* Number of newly allocated pool chunks */ - size_t new_alloc_count; - - /* Number of reused pool chunks */ - size_t reused_count; -} jmem_pools_stats_t; - -void jmem_pools_get_stats (jmem_pools_stats_t *); -void jmem_pools_stats_reset_peak (void); -void jmem_pools_stats_print (void); -#endif /* JMEM_STATS */ - -/** - * @} - * @} - */ - -#endif /* !JMEM_POOLMAN_H */ diff --git a/jerry-core/jmem/jmem-allocator.h b/jerry-core/jmem/jmem.h similarity index 53% rename from jerry-core/jmem/jmem-allocator.h rename to jerry-core/jmem/jmem.h index 0fbd5db12..edab5acc4 100644 --- a/jerry-core/jmem/jmem-allocator.h +++ b/jerry-core/jmem/jmem.h @@ -13,21 +13,36 @@ * limitations under the License. */ -/** - * Allocator interface - */ -#ifndef JMEM_ALLOCATOR_H -#define JMEM_ALLOCATOR_H - -#include "jrt.h" -#include "jmem-config.h" -#include "jmem-heap.h" -#include "jmem-poolman.h" +#ifndef JMEM_H +#define JMEM_H /** \addtogroup mem Memory allocation + * @{ + * + * \addtogroup heap Heap * @{ */ +/** + * Size of heap + */ +#define JMEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_AREA_SIZE)) + +/** + * Logarithm of required alignment for allocated units/blocks + */ +#define JMEM_ALIGNMENT_LOG 3 + +/** + * Representation of NULL value for compressed pointers + */ +#define JMEM_CP_NULL ((jmem_cpointer_t) 0) + +/** + * Required alignment for allocated units/blocks + */ +#define JMEM_ALIGNMENT (1u << JMEM_ALIGNMENT_LOG) + /** * Compressed pointer representations * @@ -57,25 +72,6 @@ typedef uint32_t jmem_cpointer_t; typedef uint16_t jmem_cpointer_t; #endif /* JERRY_CPOINTER_32_BIT */ -/** - * Width of compressed memory pointer - */ -#ifdef JERRY_CPOINTER_32_BIT -#define JMEM_CP_WIDTH 32 -#else /* !JERRY_CPOINTER_32_BIT */ -#define JMEM_CP_WIDTH 16 -#endif /* JERRY_CPOINTER_32_BIT */ - -/** - * Representation of NULL value for compressed pointers - */ -#define JMEM_CP_NULL ((jmem_cpointer_t) 0) - -/** - * Required alignment for allocated units/blocks - */ -#define JMEM_ALIGNMENT (1u << JMEM_ALIGNMENT_LOG) - /** * Severity of a 'try give memory back' request * @@ -87,32 +83,109 @@ typedef uint16_t jmem_cpointer_t; */ typedef enum { - JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW, /* 'low' severity */ - JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH, /* 'high' severity */ + JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW, /**< 'low' severity */ + JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH, /**< 'high' severity */ } jmem_free_unused_memory_severity_t; -/** - * Free region node - */ -typedef struct -{ - uint32_t next_offset; /* Offset of next region in list */ - uint32_t size; /* Size of region */ -} jmem_heap_free_t; - /** * Node for free chunk list */ typedef struct jmem_pools_chunk_t { - struct jmem_pools_chunk_t *next_p; /* pointer to next pool chunk */ + struct jmem_pools_chunk_t *next_p; /**< pointer to next pool chunk */ } jmem_pools_chunk_t; +/** + * Free region node + */ +typedef struct +{ + uint32_t next_offset; /**< Offset of next region in list */ + uint32_t size; /**< Size of region */ +} jmem_heap_free_t; + +void jmem_init (void); +void jmem_finalize (void); + +void *jmem_heap_alloc_block (const size_t size); +void *jmem_heap_alloc_block_null_on_error (const size_t size); +void jmem_heap_free_block (void *ptr, const size_t size); + +#ifdef JMEM_STATS +/** + * Heap memory usage statistics + */ +typedef struct +{ + size_t size; /**< size */ + + size_t allocated_bytes; /**< currently allocated bytes */ + size_t peak_allocated_bytes; /**< peak allocated bytes */ + size_t global_peak_allocated_bytes; /**< non-resettable peak allocated bytes */ + + size_t waste_bytes; /**< bytes waste due to blocks filled partially + * and due to block headers */ + size_t peak_waste_bytes; /**< peak bytes waste */ + size_t global_peak_waste_bytes; /**< non-resettable peak bytes waste */ + + size_t skip_count; /**< Number of skip-aheads during insertion of free block */ + size_t nonskip_count; /**< Number of times we could not skip ahead during + * free block insertion */ + + size_t alloc_count; /**< Number of allocation of new pool chunk */ + size_t alloc_iter_count; /**< Number of iterations required for allocations */ + + size_t free_count; /**< Number of freeing of pool chunk */ + size_t free_iter_count; /**< Number of iterations required for inserting free blocks */ +} jmem_heap_stats_t; + +void jmem_stats_reset_peak (void); +void jmem_stats_print (void); +#endif /* JMEM_STATS */ + +jmem_cpointer_t jmem_compress_pointer (const void *pointer_p); +void *jmem_decompress_pointer (uintptr_t compressed_pointer); + /** * A free memory callback routine type. */ typedef void (*jmem_free_unused_memory_callback_t) (jmem_free_unused_memory_severity_t); +void jmem_register_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback); +void jmem_unregister_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback); + +void jmem_run_free_unused_memory_callbacks (jmem_free_unused_memory_severity_t severity); + +/** + * Define a local array variable and allocate memory for the array on the heap. + * + * If requested number of elements is zero, assign NULL to the variable. + * + * Warning: + * if there is not enough memory on the heap, shutdown engine with ERR_OUT_OF_MEMORY. + */ +#define JMEM_DEFINE_LOCAL_ARRAY(var_name, number, type) \ +{ \ + size_t var_name ## ___size = (size_t) (number) * sizeof (type); \ + type *var_name = (type *) (jmem_heap_alloc_block (var_name ## ___size)); + +/** + * Free the previously defined local array variable, freeing corresponding block on the heap, + * if it was allocated (i.e. if the array's size was non-zero). + */ +#define JMEM_FINALIZE_LOCAL_ARRAY(var_name) \ + if (var_name != NULL) \ + { \ + JERRY_ASSERT (var_name ## ___size != 0); \ + \ + jmem_heap_free_block (var_name, var_name ## ___size); \ + } \ + else \ + { \ + JERRY_ASSERT (var_name ## ___size == 0); \ + } \ +} + /** * Get value of pointer from specified non-null compressed pointer value */ @@ -151,22 +224,32 @@ typedef void (*jmem_free_unused_memory_callback_t) (jmem_free_unused_memory_seve } \ } while (false); -void jmem_init (void); -void jmem_finalize (void); - -jmem_cpointer_t jmem_compress_pointer (const void *pointer_p); -void *jmem_decompress_pointer (uintptr_t compressed_pointer); - -void jmem_register_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback); -void jmem_unregister_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback); - +/** + * @} + * \addtogroup poolman Memory pool manager + * @{ + */ #ifdef JMEM_STATS -void jmem_stats_reset_peak (void); -void jmem_stats_print (void); +/** + * Pools' memory usage statistics + */ +typedef struct +{ + size_t pools_count; /**< pools' count */ + size_t peak_pools_count; /**< peak pools' count */ + size_t global_peak_pools_count; /**< non-resettable peak pools' count */ + size_t free_chunks; /**< free chunks count */ + size_t new_alloc_count; /**< Number of newly allocated pool chunks */ + size_t reused_count; /**< Number of reused pool chunks */ +} jmem_pools_stats_t; #endif /* JMEM_STATS */ +void *jmem_pools_alloc (size_t size); +void jmem_pools_free (void *chunk_p, size_t size); + /** + * @} * @} */ -#endif /* !JMEM_ALLOCATOR_H */ +#endif /* !JMEM_H */ diff --git a/jerry-core/parser/js/common.h b/jerry-core/parser/js/common.h index b27fba8e0..c9db1de08 100644 --- a/jerry-core/parser/js/common.h +++ b/jerry-core/parser/js/common.h @@ -34,7 +34,7 @@ #include "ecma-globals.h" #include "ecma-regexp-object.h" -#include "jmem-heap.h" +#include "jmem.h" /* Immediate management. */ diff --git a/jerry-core/parser/regexp/re-compiler.c b/jerry-core/parser/regexp/re-compiler.c index 9541aa87a..333215bec 100644 --- a/jerry-core/parser/regexp/re-compiler.c +++ b/jerry-core/parser/regexp/re-compiler.c @@ -19,7 +19,7 @@ #include "ecma-try-catch-macro.h" #include "jcontext.h" #include "jrt-libc-includes.h" -#include "jmem-heap.h" +#include "jmem.h" #include "re-bytecode.h" #include "re-compiler.h" #include "re-parser.h" diff --git a/tests/unit/test-heap.c b/tests/unit/test-heap.c index 9287377fd..7d3b598b6 100644 --- a/tests/unit/test-heap.c +++ b/tests/unit/test-heap.c @@ -13,7 +13,14 @@ * limitations under the License. */ -#include "jmem-allocator.h" +#include +#include +#include + +#include "jmem.h" + +#define JMEM_ALLOCATOR_INTERNAL +#include "jmem-allocator-internal.h" #include "test-common.h" diff --git a/tests/unit/test-poolman.c b/tests/unit/test-poolman.c index 6b89fec7a..7435e108f 100644 --- a/tests/unit/test-poolman.c +++ b/tests/unit/test-poolman.c @@ -17,10 +17,14 @@ * Unit test for pool manager. */ -#define JERRY_MEM_POOL_INTERNAL +#include +#include +#include -#include "jmem-allocator.h" -#include "jmem-poolman.h" +#include "jmem.h" + +#define JMEM_ALLOCATOR_INTERNAL +#include "jmem-allocator-internal.h" #include "test-common.h"