jerryscript/jerry-core/lit/lit-cpointer.c
László Langó 92bb551d45 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
2016-05-20 16:01:33 +02:00

62 lines
1.7 KiB
C

/* Copyright 2015 Samsung Electronics Co., Ltd.
* Copyright 2015-2016 University of Szeged
*
* 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.
*/
#include "lit-cpointer.h"
#include "jrt-bit-fields.h"
/**
* Compress pointer to extended compressed pointer.
*
* @return dynamic storage-specific extended compressed pointer
*/
inline lit_cpointer_t __attr_pure___ __attr_always_inline___
lit_cpointer_compress (lit_record_t *pointer) /**< pointer to compress */
{
if (pointer == NULL)
{
return JMEM_CP_NULL;
}
return (lit_cpointer_t) jmem_compress_pointer (pointer);
} /* lit_cpointer_compress */
/**
* Decompress extended compressed pointer.
*
* @return decompressed pointer
*/
inline lit_record_t * __attr_pure___ __attr_always_inline___
lit_cpointer_decompress (lit_cpointer_t compressed_pointer) /**< recordset-specific compressed pointer */
{
if (compressed_pointer == JMEM_CP_NULL)
{
return NULL;
}
return (lit_record_t *) jmem_decompress_pointer (compressed_pointer);
} /* lit_cpointer_decompress */
/**
* Create NULL compressed pointer.
*
* @return NULL compressed pointer
*/
inline lit_cpointer_t __attr_pure___ __attr_always_inline___
lit_cpointer_null_cp (void)
{
return JMEM_CP_NULL;
} /* lit_cpointer_null_cp */