Switching to g++ and corresponding changes according to C++ requirements.
This commit is contained in:
+17
-9
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,11 +20,14 @@
|
||||
#include "mem-pool.h"
|
||||
#include "mem-poolman.h"
|
||||
|
||||
extern void srand (unsigned int __seed);
|
||||
extern int rand (void);
|
||||
extern long int time (long int *__timer);
|
||||
extern int printf (__const char *__restrict __format, ...);
|
||||
extern void *memset (void *__s, int __c, size_t __n);
|
||||
extern "C"
|
||||
{
|
||||
extern void srand (unsigned int __seed);
|
||||
extern int rand (void);
|
||||
extern long int time (long int *__timer);
|
||||
extern int printf (__const char *__restrict __format, ...);
|
||||
extern void *memset (void *__s, int __c, size_t __n);
|
||||
}
|
||||
|
||||
// Iterations count
|
||||
const uint32_t test_iters = 64;
|
||||
@@ -32,6 +35,11 @@ const uint32_t test_iters = 64;
|
||||
// Subiterations count
|
||||
const uint32_t test_max_sub_iters = 1024;
|
||||
|
||||
#define TEST_POOL_SPACE_SIZE (sizeof (mem_pool_state_t) + (1ull << MEM_POOL_MAX_CHUNKS_NUMBER_LOG) * MEM_POOL_CHUNK_SIZE)
|
||||
uint8_t test_pool [TEST_POOL_SPACE_SIZE] __attribute__((aligned(MEM_ALIGNMENT)));
|
||||
|
||||
uint8_t* ptrs[test_max_sub_iters];
|
||||
|
||||
int
|
||||
main( int __unused argc,
|
||||
char __unused **argv)
|
||||
@@ -43,13 +51,13 @@ main( int __unused argc,
|
||||
|
||||
for ( uint32_t i = 0; i < test_iters; i++ )
|
||||
{
|
||||
uint8_t test_pool[MEM_POOL_SIZE] __attribute__((aligned(MEM_ALIGNMENT)));
|
||||
mem_pool_state_t* pool_p = (mem_pool_state_t*) test_pool;
|
||||
|
||||
mem_pool_init( pool_p, MEM_POOL_SIZE);
|
||||
JERRY_ASSERT (MEM_POOL_SIZE <= TEST_POOL_SPACE_SIZE);
|
||||
|
||||
mem_pool_init (pool_p, MEM_POOL_SIZE);
|
||||
|
||||
const size_t subiters = ( (size_t) rand() % test_max_sub_iters ) + 1;
|
||||
uint8_t* ptrs[subiters];
|
||||
|
||||
for ( size_t j = 0; j < subiters; j++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user