Promote dynamic memory management from debugger transport to core API (#2503)
Under the cover of the debugger transport layer, allocation on the engine's heap has been made available to the public. As there are actually no restrictions on what the allocated memory can be used for, the memory management functions better fit in the core part of the API. Closes #1805 JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -29,28 +29,6 @@
|
||||
*/
|
||||
#define JERRY_DEBUGGER_TRANSPORT_TIMEOUT 100
|
||||
|
||||
/**
|
||||
* Allocate memory for a connection.
|
||||
*
|
||||
* @return allocated memory on success
|
||||
* NULL otherwise
|
||||
*/
|
||||
void *
|
||||
jerry_debugger_transport_malloc (size_t size) /**< size of the memory block */
|
||||
{
|
||||
return jmem_heap_alloc_block_null_on_error (size);
|
||||
} /* jerry_debugger_transport_malloc */
|
||||
|
||||
/**
|
||||
* Free memory allocated for a connection.
|
||||
*/
|
||||
void
|
||||
jerry_debugger_transport_free (void *mem_p, /**< value returned by jerry_debugger_transport_malloc() */
|
||||
size_t size) /**< same size passed to jerry_debugger_transport_malloc() */
|
||||
{
|
||||
jmem_heap_free_block (mem_p, size);
|
||||
} /* jerry_debugger_transport_free */
|
||||
|
||||
/**
|
||||
* Add a new transport layer.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user