… | |
… | |
3838 | fine. |
3838 | fine. |
3839 | |
3839 | |
3840 | If your embedding application does not need any priorities, defining these |
3840 | If your embedding application does not need any priorities, defining these |
3841 | both to C<0> will save some memory and CPU. |
3841 | both to C<0> will save some memory and CPU. |
3842 | |
3842 | |
3843 | =item EV_PERIODIC_ENABLE |
3843 | =item EV_PERIODIC_ENABLE, EV_IDLE_ENABLE, EV_EMBED_ENABLE, EV_STAT_ENABLE, |
|
|
3844 | EV_PREPARE_ENABLE, EV_CHECK_ENABLE, EV_FORK_ENABLE, EV_SIGNAL_ENABLE, |
|
|
3845 | EV_ASYNC_ENABLE, EV_CHILD_ENABLE. |
3844 | |
3846 | |
3845 | If undefined or defined to be C<1>, then periodic timers are supported. If |
3847 | If undefined or defined to be C<1> (and the platform supports it), then |
3846 | defined to be C<0>, then they are not. Disabling them saves a few kB of |
3848 | the respective watcher type is supported. If defined to be C<0>, then it |
3847 | code. |
3849 | is not. Disabling watcher types mainly saves codesize. |
3848 | |
|
|
3849 | =item EV_IDLE_ENABLE |
|
|
3850 | |
|
|
3851 | If undefined or defined to be C<1>, then idle watchers are supported. If |
|
|
3852 | defined to be C<0>, then they are not. Disabling them saves a few kB of |
|
|
3853 | code. |
|
|
3854 | |
|
|
3855 | =item EV_EMBED_ENABLE |
|
|
3856 | |
|
|
3857 | If undefined or defined to be C<1>, then embed watchers are supported. If |
|
|
3858 | defined to be C<0>, then they are not. Embed watchers rely on most other |
|
|
3859 | watcher types, which therefore must not be disabled. |
|
|
3860 | |
|
|
3861 | =item EV_STAT_ENABLE |
|
|
3862 | |
|
|
3863 | If undefined or defined to be C<1>, then stat watchers are supported. If |
|
|
3864 | defined to be C<0>, then they are not. |
|
|
3865 | |
|
|
3866 | =item EV_FORK_ENABLE |
|
|
3867 | |
|
|
3868 | If undefined or defined to be C<1>, then fork watchers are supported. If |
|
|
3869 | defined to be C<0>, then they are not. |
|
|
3870 | |
|
|
3871 | =item EV_SIGNAL_ENABLE |
|
|
3872 | |
|
|
3873 | If undefined or defined to be C<1>, then signal watchers are supported. If |
|
|
3874 | defined to be C<0>, then they are not. |
|
|
3875 | |
|
|
3876 | =item EV_ASYNC_ENABLE |
|
|
3877 | |
|
|
3878 | If undefined or defined to be C<1>, then async watchers are supported. If |
|
|
3879 | defined to be C<0>, then they are not. |
|
|
3880 | |
|
|
3881 | =item EV_CHILD_ENABLE |
|
|
3882 | |
|
|
3883 | If undefined or defined to be C<1> (and C<_WIN32> is not defined), then |
|
|
3884 | child watchers are supported. If defined to be C<0>, then they are not. |
|
|
3885 | |
3850 | |
3886 | =item EV_MINIMAL |
3851 | =item EV_MINIMAL |
3887 | |
3852 | |
3888 | If you need to shave off some kilobytes of code at the expense of some |
3853 | If you need to shave off some kilobytes of code at the expense of some |
3889 | speed (but with the full API), define this symbol to C<1>. Currently this |
3854 | speed (but with the full API), define this symbol to C<1>. Currently this |
… | |
… | |
3900 | Defining C<EV_MINIMAL> to C<2> will additionally reduce the core API to |
3865 | Defining C<EV_MINIMAL> to C<2> will additionally reduce the core API to |
3901 | provide a bare-bones event library. See C<ev.h> for details on what parts |
3866 | provide a bare-bones event library. See C<ev.h> for details on what parts |
3902 | of the API are still available, and do not complain if this subset changes |
3867 | of the API are still available, and do not complain if this subset changes |
3903 | over time. |
3868 | over time. |
3904 | |
3869 | |
3905 | This example set of settings reduces the compiled size of libev from 24Kb |
3870 | This example set of settings reduces the compiled size of libev from |
3906 | to 8Kb on my GNU/Linux amd64 system (and leaves little in - there is also |
3871 | 23.9Kb to 7.7Kb on my GNU/Linux amd64 system (and leaves little |
3907 | an effect on the amount of memory used). With an intelligent-enough linker |
3872 | in - there is also an effect on the amount of memory used). With |
3908 | further unused functions might be left out as well automatically. |
3873 | an intelligent-enough linker (gcc+binutils do this when you use |
|
|
3874 | C<-Wl,--gc-sections -ffunction-sections>) further unused functions might |
|
|
3875 | be left out as well automatically - a binary starting a timer and an I/O |
|
|
3876 | watcher then might come out at only 5Kb. |
3909 | |
3877 | |
3910 | // tuning and API changes |
3878 | // tuning and API changes |
3911 | #define EV_MINIMAL 2 |
3879 | #define EV_MINIMAL 2 |
3912 | #define EV_MULTIPLICITY 0 |
3880 | #define EV_MULTIPLICITY 0 |
3913 | #define EV_MINPRI 0 |
3881 | #define EV_MINPRI 0 |
… | |
… | |
3929 | |
3897 | |
3930 | // disable all watcher types that cna be disabled |
3898 | // disable all watcher types that cna be disabled |
3931 | #define EV_STAT_ENABLE 0 |
3899 | #define EV_STAT_ENABLE 0 |
3932 | #define EV_PERIODIC_ENABLE 0 |
3900 | #define EV_PERIODIC_ENABLE 0 |
3933 | #define EV_IDLE_ENABLE 0 |
3901 | #define EV_IDLE_ENABLE 0 |
|
|
3902 | #define EV_CHECK_ENABLE 0 |
|
|
3903 | #define EV_PREPARE_ENABLE 0 |
3934 | #define EV_FORK_ENABLE 0 |
3904 | #define EV_FORK_ENABLE 0 |
3935 | #define EV_SIGNAL_ENABLE 0 |
3905 | #define EV_SIGNAL_ENABLE 0 |
3936 | #define EV_CHILD_ENABLE 0 |
3906 | #define EV_CHILD_ENABLE 0 |
3937 | #define EV_ASYNC_ENABLE 0 |
3907 | #define EV_ASYNC_ENABLE 0 |
3938 | #define EV_EMBED_ENABLE 0 |
3908 | #define EV_EMBED_ENABLE 0 |