libtealet
0.4.2
Loading...
Searching...
No Matches
tealet_extras.h
Go to the documentation of this file.
1
5
#include "
tealet.h
"
6
#ifndef _TEALET_EXTRAS_H_
7
#define _TEALET_EXTRAS_H_
8
9
/****************************************************************
10
* A tealet allocator that gathers usage statistics
11
*/
12
13
typedef
struct
tealet_statsalloc_t
{
14
tealet_alloc_t
alloc;
15
tealet_alloc_t
*base;
16
size_t
n_allocs;
17
size_t
s_allocs;
18
}
tealet_statsalloc_t
;
19
20
TEALET_API
21
void
tealet_statsalloc_init(
tealet_statsalloc_t
*alloc,
tealet_alloc_t
*base);
22
23
/****************************************************************
24
* A tealet stub mechanism.
25
* A stub is a special paused tealet, that can be restarted to
26
* run any function. It can also be duplicated, providing a
27
* convenient mechanism to start a family of tealets from a common
28
* position on the stack.
29
*/
30
31
/* create a stub and return it */
32
TEALET_API
33
tealet_t
*tealet_stub_new(
tealet_t
*tealet,
void
*stack_far);
34
35
/*
36
* Run a previously created stub.
37
* Behaviour is similar to tealet_new(), except that 'stub' must be the
38
* result of tealet_stub_new(), or the result
39
* of tealet_duplicate() on such a stub. Otherwise
40
* behaviour is undefined.
41
*/
42
TEALET_API
43
int
tealet_stub_run(
tealet_t
*stub,
tealet_run_t
run,
void
**parg);
44
45
#endif
/* _TEALET_EXTRAS_H_ */
tealet_alloc_t
Definition
tealet.h:40
tealet_statsalloc_t
Definition
tealet_extras.h:13
tealet_t
Definition
tealet.h:61
tealet.h
Public core API for libtealet.
tealet_run_t
tealet_t *(* tealet_run_t)(tealet_t *current, void *arg)
Definition
tealet.h:74
src
tealet_extras.h
Generated by
1.9.8