diff options
| author | 2009-10-12 06:10:50 +0200 | |
|---|---|---|
| committer | 2009-10-12 06:10:50 +0200 | |
| commit | 07378b9203f949fb7a475115051edb09f134d8ff (patch) | |
| tree | fe787e4a29d23c1718264fbec7feb58377944ccd /common/utils.c | |
| parent | ac37795c7cca4d297ff860678a4197ee94d80f20 (diff) | |
| download | usbmuxd-07378b9203f949fb7a475115051edb09f134d8ff.tar.gz usbmuxd-07378b9203f949fb7a475115051edb09f134d8ff.tar.bz2 | |
optimize: persist fdlist for duration of main_loop
constant malloc and realloc was wasting lots of time
Diffstat (limited to 'common/utils.c')
| -rw-r--r-- | common/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/utils.c b/common/utils.c index 6803941..f66d889 100644 --- a/common/utils.c +++ b/common/utils.c | |||
| @@ -65,6 +65,11 @@ void fdlist_free(struct fdlist *list) | |||
| 65 | list->fds = NULL; | 65 | list->fds = NULL; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void fdlist_reset(struct fdlist *list) | ||
| 69 | { | ||
| 70 | list->count = 0; | ||
| 71 | } | ||
| 72 | |||
| 68 | void collection_init(struct collection *col) | 73 | void collection_init(struct collection *col) |
| 69 | { | 74 | { |
| 70 | col->list = malloc(sizeof(void *)); | 75 | col->list = malloc(sizeof(void *)); |
