Introducing "on-stack" ecma-string descriptors and using them in get_variable_value / set_variable_value.
This commit is contained in:
@@ -125,3 +125,22 @@ mem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress
|
||||
|
||||
return (void*) int_ptr;
|
||||
} /* mem_decompress_pointer */
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
/**
|
||||
* Check whether the pointer points to the heap
|
||||
*
|
||||
* Note:
|
||||
* the routine should be used only for assertion checks
|
||||
*
|
||||
* @return true - if pointer points to the heap,
|
||||
* false - otherwise
|
||||
*/
|
||||
bool
|
||||
mem_is_heap_pointer (void *pointer) /**< pointer */
|
||||
{
|
||||
uint8_t *uint8_pointer = pointer;
|
||||
|
||||
return (uint8_pointer >= mem_heap_area && uint8_pointer <= (mem_heap_area + MEM_HEAP_AREA_SIZE));
|
||||
} /* mem_is_heap_pointer */
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
@@ -49,6 +49,10 @@ extern void mem_finalize (bool is_show_mem_stats);
|
||||
extern uintptr_t mem_compress_pointer (void *pointer);
|
||||
extern void* mem_decompress_pointer (uintptr_t compressed_pointer);
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
extern bool mem_is_heap_pointer (void *pointer);
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
#endif /* !JERRY_MEM_ALLOCATOR_H */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user