Ensure that const and pure function attributes are used properly (#1739)
Some functions were incorrectly marked as const but were pure only (or not even pure). Some functions were marked as pure but qualified as const. Some functions were not attributed at all but qualified either as pure or const. Some functions had attributes at definition but not at declaration. This commit fixes these inconsistencies. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -56,7 +56,7 @@ jmem_finalize (void)
|
||||
*
|
||||
* @return packed pointer
|
||||
*/
|
||||
inline jmem_cpointer_t __attr_always_inline___
|
||||
inline jmem_cpointer_t __attr_pure___ __attr_always_inline___
|
||||
jmem_compress_pointer (const void *pointer_p) /**< pointer to compress */
|
||||
{
|
||||
JERRY_ASSERT (pointer_p != NULL);
|
||||
@@ -90,7 +90,7 @@ jmem_compress_pointer (const void *pointer_p) /**< pointer to compress */
|
||||
*
|
||||
* @return unpacked pointer
|
||||
*/
|
||||
inline void * __attr_always_inline___
|
||||
inline void * __attr_pure___ __attr_always_inline___
|
||||
jmem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress */
|
||||
{
|
||||
JERRY_ASSERT (compressed_pointer != JMEM_CP_NULL);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#ifndef JMEM_H
|
||||
#define JMEM_H
|
||||
|
||||
#include "jrt.h"
|
||||
|
||||
/** \addtogroup mem Memory allocation
|
||||
* @{
|
||||
*
|
||||
@@ -143,8 +145,8 @@ 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);
|
||||
jmem_cpointer_t jmem_compress_pointer (const void *pointer_p) __attr_pure___;
|
||||
void *jmem_decompress_pointer (uintptr_t compressed_pointer) __attr_pure___;
|
||||
|
||||
/**
|
||||
* A free memory callback routine type.
|
||||
|
||||
Reference in New Issue
Block a user