Change 'mem' namspace to 'jmem'
The 'mem_' prefix is too general, so it might clash with symbols in other libraries. Renamed the directory, file, funtion and type names. Related issue: #1052 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
+15
-15
@@ -20,8 +20,8 @@
|
||||
|
||||
#define JERRY_MEM_POOL_INTERNAL
|
||||
|
||||
#include "mem-allocator.h"
|
||||
#include "mem-poolman.h"
|
||||
#include "jmem-allocator.h"
|
||||
#include "jmem-poolman.h"
|
||||
|
||||
#include "test-common.h"
|
||||
|
||||
@@ -32,7 +32,7 @@ const uint32_t test_iters = 1024;
|
||||
#define TEST_MAX_SUB_ITERS 1024
|
||||
|
||||
uint8_t *ptrs[TEST_MAX_SUB_ITERS];
|
||||
uint8_t data[TEST_MAX_SUB_ITERS][MEM_POOL_CHUNK_SIZE];
|
||||
uint8_t data[TEST_MAX_SUB_ITERS][JMEM_POOL_CHUNK_SIZE];
|
||||
|
||||
int
|
||||
main (int __attr_unused___ argc,
|
||||
@@ -40,7 +40,7 @@ main (int __attr_unused___ argc,
|
||||
{
|
||||
TEST_INIT ();
|
||||
|
||||
mem_init ();
|
||||
jmem_init ();
|
||||
|
||||
for (uint32_t i = 0; i < test_iters; i++)
|
||||
{
|
||||
@@ -48,42 +48,42 @@ main (int __attr_unused___ argc,
|
||||
|
||||
for (size_t j = 0; j < subiters; j++)
|
||||
{
|
||||
ptrs[j] = (uint8_t *) mem_pools_alloc ();
|
||||
ptrs[j] = (uint8_t *) jmem_pools_alloc ();
|
||||
|
||||
if (ptrs[j] != NULL)
|
||||
{
|
||||
for (size_t k = 0; k < MEM_POOL_CHUNK_SIZE; k++)
|
||||
for (size_t k = 0; k < JMEM_POOL_CHUNK_SIZE; k++)
|
||||
{
|
||||
ptrs[j][k] = (uint8_t) (rand () % 256);
|
||||
}
|
||||
|
||||
memcpy (data[j], ptrs[j], MEM_POOL_CHUNK_SIZE);
|
||||
memcpy (data[j], ptrs[j], JMEM_POOL_CHUNK_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
// mem_heap_print (false);
|
||||
/* jmem_heap_print (false); */
|
||||
|
||||
for (size_t j = 0; j < subiters; j++)
|
||||
{
|
||||
if (rand () % 256 == 0)
|
||||
{
|
||||
mem_pools_collect_empty ();
|
||||
jmem_pools_collect_empty ();
|
||||
}
|
||||
|
||||
if (ptrs[j] != NULL)
|
||||
{
|
||||
JERRY_ASSERT (!memcmp (data[j], ptrs[j], MEM_POOL_CHUNK_SIZE));
|
||||
JERRY_ASSERT (!memcmp (data[j], ptrs[j], JMEM_POOL_CHUNK_SIZE));
|
||||
|
||||
mem_pools_free (ptrs[j]);
|
||||
jmem_pools_free (ptrs[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MEM_STATS
|
||||
mem_pools_stats_print ();
|
||||
#endif /* MEM_STATS */
|
||||
#ifdef JMEM_STATS
|
||||
jmem_pools_stats_print ();
|
||||
#endif /* JMEM_STATS */
|
||||
|
||||
mem_finalize (false);
|
||||
jmem_finalize (false);
|
||||
|
||||
return 0;
|
||||
} /* main */
|
||||
|
||||
Reference in New Issue
Block a user