Remove allocator functions which stores size.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-08-17 07:57:53 -07:00
parent 823e4d030c
commit 27253112c2
6 changed files with 8 additions and 41 deletions
-31
View File
@@ -408,26 +408,6 @@ jmem_heap_alloc_block_null_on_error (const size_t size) /**< required memory siz
return jmem_heap_gc_and_alloc_block (size, true);
} /* jmem_heap_alloc_block_null_on_error */
/**
* Allocate block and store block size.
*
* Note: block will only be aligned to 4 bytes.
*/
inline void * __attr_always_inline___
jmem_heap_alloc_block_store_size (size_t size) /**< required size */
{
if (unlikely (size == 0))
{
return NULL;
}
size += sizeof (jmem_heap_free_t);
jmem_heap_free_t *const data_space_p = (jmem_heap_free_t *) jmem_heap_alloc_block (size);
data_space_p->size = (uint32_t) size;
return (void *) (data_space_p + 1);
} /* jmem_heap_alloc_block_store_size */
/**
* Free the memory block.
*/
@@ -540,17 +520,6 @@ jmem_heap_free_block (void *ptr, /**< pointer to beginning of data space of the
JMEM_HEAP_STAT_FREE (size);
} /* jmem_heap_free_block */
/**
* Free block with stored size
*/
inline void __attr_always_inline___
jmem_heap_free_block_size_stored (void *ptr) /**< pointer to the memory block */
{
jmem_heap_free_t *const original_p = ((jmem_heap_free_t *) ptr) - 1;
JERRY_ASSERT (original_p + 1 == ptr);
jmem_heap_free_block (original_p, original_p->size);
} /* jmem_heap_free_block_size_stored */
/**
* Compress pointer
*
-2
View File
@@ -34,8 +34,6 @@ extern void jmem_heap_finalize (void);
extern void *jmem_heap_alloc_block (const size_t);
extern void *jmem_heap_alloc_block_null_on_error (const size_t);
extern void jmem_heap_free_block (void *, const size_t);
extern void *jmem_heap_alloc_block_store_size (size_t);
extern void jmem_heap_free_block_size_stored (void *);
extern uintptr_t jmem_heap_compress_pointer (const void *);
extern void *jmem_heap_decompress_pointer (uintptr_t);
extern bool jmem_is_heap_pointer (const void *);