Update the webpage
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
@@ -179,6 +179,26 @@ typedef struct
|
|||||||
} jerry_property_descriptor_t;
|
} jerry_property_descriptor_t;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## jerry_heap_stats_t
|
||||||
|
|
||||||
|
**summary**
|
||||||
|
|
||||||
|
Description of JerryScript heap memory stats.
|
||||||
|
It is for memory profiling.
|
||||||
|
|
||||||
|
**Prototype**
|
||||||
|
|
||||||
|
```c
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
size_t version /**< the version of the stats struct */
|
||||||
|
size_t size; /**< heap total size */
|
||||||
|
size_t allocated_bytes; /**< currently allocated bytes */
|
||||||
|
size_t peak_allocated_bytes; /**< peak allocated bytes */
|
||||||
|
size_t reserved[4]; /**< padding for future extensions */
|
||||||
|
} jerry_heap_stats_t;
|
||||||
|
```
|
||||||
|
|
||||||
## jerry_external_handler_t
|
## jerry_external_handler_t
|
||||||
|
|
||||||
**Summary**
|
**Summary**
|
||||||
@@ -533,6 +553,36 @@ main (void)
|
|||||||
- [jerry_cleanup](#jerry_cleanup)
|
- [jerry_cleanup](#jerry_cleanup)
|
||||||
|
|
||||||
|
|
||||||
|
## jerry_get_memory_stats
|
||||||
|
|
||||||
|
**Summary**
|
||||||
|
|
||||||
|
Get heap memory stats.
|
||||||
|
|
||||||
|
**Prototype**
|
||||||
|
|
||||||
|
```c
|
||||||
|
bool
|
||||||
|
jerry_get_memory_stats (jerry_heap_stats_t *out_stats_p);
|
||||||
|
```
|
||||||
|
|
||||||
|
- `out_stats_p` - out parameter, that provides the heap statistics.
|
||||||
|
- return value
|
||||||
|
- true, if run was successful
|
||||||
|
- false, otherwise. Usually it is because the MEM_STATS feature is not enabled.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
```c
|
||||||
|
jerry_heap_stats_t stats = {0};
|
||||||
|
bool get_stats_ret = jerry_get_memory_stats (&stats);
|
||||||
|
```
|
||||||
|
|
||||||
|
**See also**
|
||||||
|
|
||||||
|
- [jerry_init](#jerry_init)
|
||||||
|
|
||||||
|
|
||||||
## jerry_gc
|
## jerry_gc
|
||||||
|
|
||||||
**Summary**
|
**Summary**
|
||||||
|
|||||||
+51
-6
@@ -35,18 +35,25 @@ can be used for transmitting debugger messages.
|
|||||||
## Debugging JavaScript applications
|
## Debugging JavaScript applications
|
||||||
|
|
||||||
The debugger client must be connected to the server before the
|
The debugger client must be connected to the server before the
|
||||||
JavaScript application runs. On-the-fly attachment is not supported
|
JavaScript application runs. On-the-fly attachment is supported
|
||||||
because the debugging information (e.g. line index of each possible
|
for more than one file, right after of engine initialization
|
||||||
breakpoint location) is not preserved by JerryScript. The client is
|
(this feature available with the python client). The debugging
|
||||||
expected to be run on a system with much more resources and it should
|
information (e.g. line index of each possible -breakpoint location)
|
||||||
be capable of storing this information. JerryScript frees all debug
|
is not preserved by JerryScript. The client is expected to be run
|
||||||
information after it is transmitted to the client to save memory.
|
on a system with much more resources and it should be capable of
|
||||||
|
storing this information. JerryScript frees all debug information
|
||||||
|
after it is transmitted to the client to save memory.
|
||||||
|
|
||||||
The following argument makes JerryScript wait for a client
|
The following argument makes JerryScript wait for a client
|
||||||
connection:
|
connection:
|
||||||
|
|
||||||
`--start-debug-server`
|
`--start-debug-server`
|
||||||
|
|
||||||
|
The following argument makes JerryScript wait for a client
|
||||||
|
source code:
|
||||||
|
|
||||||
|
`--debugger-wait-source`
|
||||||
|
|
||||||
It is also recommended to increase the log level to see
|
It is also recommended to increase the log level to see
|
||||||
the *Waiting for client connection* message:
|
the *Waiting for client connection* message:
|
||||||
|
|
||||||
@@ -204,3 +211,41 @@ jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint)
|
|||||||
jerry_debugger_stop_at_breakpoint (false);
|
jerry_debugger_stop_at_breakpoint (false);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### jerry_debugger_wait_and_run_client_source
|
||||||
|
|
||||||
|
**Summary**
|
||||||
|
|
||||||
|
Stops the engine and puts that into a waiting loop. If the client send
|
||||||
|
a source code and the JerryScript receive that, then the function will
|
||||||
|
run the source with the initialized options, after that the engine will
|
||||||
|
wait for a new source until the client send a close signal.
|
||||||
|
|
||||||
|
**Prototype**
|
||||||
|
|
||||||
|
```c
|
||||||
|
jerry_debugger_wait_and_run_type_t
|
||||||
|
jerry_debugger_wait_and_run_client_source (jerry_value_t *return_value)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
```c
|
||||||
|
jerry_init (JERRY_INIT_DEBUGGER);
|
||||||
|
|
||||||
|
jerry_value_t run_result;
|
||||||
|
jerry_debugger_wait_and_run_type_t receive_status;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
receive_status = jerry_debugger_wait_and_run_client_source (&run_result);
|
||||||
|
|
||||||
|
if (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED)
|
||||||
|
{
|
||||||
|
// Handle the fail (e.g. create an error).
|
||||||
|
}
|
||||||
|
|
||||||
|
jerry_release_value (run_result);
|
||||||
|
}
|
||||||
|
while (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVED);
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user