mirror of
https://github.com/wassname/ray.git
synced 2026-09-12 12:51:15 +08:00
Implement object table API (#16)
This commit is contained in:
committed by
Robert Nishihara
parent
d11161bb01
commit
6c6f2d0473
+12
-5
@@ -12,6 +12,13 @@ void event_loop_init(event_loop *loop) {
|
||||
utarray_new(loop->waiting, &poll_icd);
|
||||
}
|
||||
|
||||
/* Free the space associated to the event loop.
|
||||
* Does not free the event_loop datastructure itself. */
|
||||
void event_loop_free(event_loop *loop) {
|
||||
utarray_free(loop->items);
|
||||
utarray_free(loop->waiting);
|
||||
}
|
||||
|
||||
/* Add a new file descriptor fd to the event loop.
|
||||
* This function sets a user defined type and id for the file descriptor
|
||||
* which can be queried using event_loop_type and event_loop_id. The parameter
|
||||
@@ -83,9 +90,9 @@ void *event_loop_get_data(event_loop *loop, int64_t index) {
|
||||
return item->data;
|
||||
}
|
||||
|
||||
/* Free the space associated to the event loop.
|
||||
* Does not free the event_loop datastructure itself. */
|
||||
void event_loop_free(event_loop *loop) {
|
||||
utarray_free(loop->items);
|
||||
utarray_free(loop->waiting);
|
||||
/* Return the type of connection. */
|
||||
int event_loop_type(event_loop *loop, int64_t index) {
|
||||
event_loop_item *item =
|
||||
(event_loop_item *) utarray_eltptr(loop->items, index);
|
||||
return item->type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user