Introducing global context.
Currently the static variables of the allocator are moved into a global structure. The future plan is supporting multiple context models with different advantages and disadvantages. Users can select the most appropriate context model for their own use case. This context model must be selected at compile time using compiler defines. Currently only one model is implemented, which will be the default context model: the context is stored in global variables, so only a single context is available which always exists. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -69,7 +69,24 @@ typedef enum
|
||||
} jmem_free_unused_memory_severity_t;
|
||||
|
||||
/**
|
||||
* A 'try give memory back' callback routine type.
|
||||
* Free region node
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t next_offset; /* Offset of next region in list */
|
||||
uint32_t size; /* Size of region */
|
||||
} jmem_heap_free_t;
|
||||
|
||||
/**
|
||||
* Node for free chunk list
|
||||
*/
|
||||
typedef struct mem_pools_chunk
|
||||
{
|
||||
struct mem_pools_chunk *next_p; /* pointer to next pool chunk */
|
||||
} jmem_pools_chunk_t;
|
||||
|
||||
/**
|
||||
* A free memory callback routine type.
|
||||
*/
|
||||
typedef void (*jmem_free_unused_memory_callback_t) (jmem_free_unused_memory_severity_t);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user