mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
This approach has the benefit that it does not require any *a priori* initialization, and that each context pointer is identified by the way in which it was created. Additionally, retrieving the context pointer now requires that the entity responsible for creating/destroying it (the manager) be given. Since managers are stored in global static const structures, they should not normally be visible across source files, and thus there should be no danger that a context item will be retrieved by the wrong manager and thus cast into the wrong data type. Since the items are stored in a linked list, their number will be limited to exactly as many as are needed for a given context, with the caveat that storing too many on a context will cause slow retrieval. Thanks @mhdawson for the idea! Fixes https://github.com/jerryscript-project/jerryscript/issues/1845 JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com