New Allocator and improved String handling.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2016-02-11 14:46:08 +01:00
parent 3d6339bbf4
commit d47c36f1b4
45 changed files with 1383 additions and 4288 deletions
+61
View File
@@ -0,0 +1,61 @@
/* 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
*/
lit_cpointer_t __attr_pure___ __attr_always_inline___
lit_cpointer_compress (lit_record_t *pointer) /**< pointer to compress */
{
if (pointer == NULL)
{
return MEM_CP_NULL;
}
return (lit_cpointer_t) mem_compress_pointer (pointer);
} /* lit_cpointer_compress */
/**
* Decompress extended compressed pointer.
*
* @return decompressed pointer
*/
lit_record_t * __attr_pure___ __attr_always_inline___
lit_cpointer_decompress (lit_cpointer_t compressed_pointer) /**< recordset-specific compressed pointer */
{
if (compressed_pointer == MEM_CP_NULL)
{
return NULL;
}
return (lit_record_t *) mem_decompress_pointer (compressed_pointer);
} /* lit_cpointer_decompress */
/**
* Create NULL compressed pointer.
*
* @return NULL compressed pointer
*/
lit_cpointer_t __attr_pure___ __attr_always_inline___
lit_cpointer_null_cp (void)
{
return MEM_CP_NULL;
} /* lit_cpointer_null_cp */