… | |
… | |
3866 | =item EV_FORK_ENABLE |
3866 | =item EV_FORK_ENABLE |
3867 | |
3867 | |
3868 | If undefined or defined to be C<1>, then fork watchers are supported. If |
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. |
3869 | defined to be C<0>, then they are not. |
3870 | |
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 | |
3871 | =item EV_ASYNC_ENABLE |
3876 | =item EV_ASYNC_ENABLE |
3872 | |
3877 | |
3873 | If undefined or defined to be C<1>, then async watchers are supported. If |
3878 | If undefined or defined to be C<1>, then async watchers are supported. If |
3874 | defined to be C<0>, then they are not. |
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. |
3875 | |
3885 | |
3876 | =item EV_MINIMAL |
3886 | =item EV_MINIMAL |
3877 | |
3887 | |
3878 | If you need to shave off some kilobytes of code at the expense of some |
3888 | If you need to shave off some kilobytes of code at the expense of some |
3879 | speed (but with the full API), define this symbol to C<1>. Currently this |
3889 | speed (but with the full API), define this symbol to C<1>. Currently this |
… | |
… | |
3881 | on amd64. It also selects a much smaller 2-heap for timer management over |
3891 | on amd64. It also selects a much smaller 2-heap for timer management over |
3882 | the default 4-heap. |
3892 | the default 4-heap. |
3883 | |
3893 | |
3884 | You can save even more by disabling watcher types you do not need |
3894 | You can save even more by disabling watcher types you do not need |
3885 | and setting C<EV_MAXPRI> == C<EV_MINPRI>. Also, disabling C<assert> |
3895 | and setting C<EV_MAXPRI> == C<EV_MINPRI>. Also, disabling C<assert> |
3886 | (C<-DNDEBUG>) will usually reduce code size a lot. |
3896 | (C<-DNDEBUG>) will usually reduce code size a lot. Disabling inotify, |
|
|
3897 | eventfd and signalfd will further help, and disabling backends one doesn't |
|
|
3898 | need (e.g. poll, epoll, kqueue, ports) will help further. |
3887 | |
3899 | |
3888 | Defining C<EV_MINIMAL> to C<2> will additionally reduce the core API to |
3900 | Defining C<EV_MINIMAL> to C<2> will additionally reduce the core API to |
3889 | provide a bare-bones event library. See C<ev.h> for details on what parts |
3901 | provide a bare-bones event library. See C<ev.h> for details on what parts |
3890 | of the API are still available, and do not complain if this subset changes |
3902 | of the API are still available, and do not complain if this subset changes |
3891 | over time. |
3903 | over time. |
|
|
3904 | |
|
|
3905 | This example set of settings reduces the compiled size of libev from 24Kb |
|
|
3906 | to 8Kb on my GNU/Linux amd64 system (and leaves little in - there is also |
|
|
3907 | an effect on the amount of memory used). With an intelligent-enough linker |
|
|
3908 | further unused functions might be left out as well automatically. |
|
|
3909 | |
|
|
3910 | // tuning and API changes |
|
|
3911 | #define EV_MINIMAL 2 |
|
|
3912 | #define EV_MULTIPLICITY 0 |
|
|
3913 | #define EV_MINPRI 0 |
|
|
3914 | #define EV_MAXPRI 0 |
|
|
3915 | |
|
|
3916 | // OS-specific backends |
|
|
3917 | #define EV_USE_INOTIFY 0 |
|
|
3918 | #define EV_USE_EVENTFD 0 |
|
|
3919 | #define EV_USE_SIGNALFD 0 |
|
|
3920 | #define EV_USE_REALTIME 0 |
|
|
3921 | #define EV_USE_MONOTONIC 0 |
|
|
3922 | #define EV_USE_CLOCK_SYSCALL 0 |
|
|
3923 | |
|
|
3924 | // disable all backends except select |
|
|
3925 | #define EV_USE_POLL 0 |
|
|
3926 | #define EV_USE_PORT 0 |
|
|
3927 | #define EV_USE_KQUEUE 0 |
|
|
3928 | #define EV_USE_EPOLL 0 |
|
|
3929 | |
|
|
3930 | // disable all watcher types that cna be disabled |
|
|
3931 | #define EV_STAT_ENABLE 0 |
|
|
3932 | #define EV_PERIODIC_ENABLE 0 |
|
|
3933 | #define EV_IDLE_ENABLE 0 |
|
|
3934 | #define EV_FORK_ENABLE 0 |
|
|
3935 | #define EV_SIGNAL_ENABLE 0 |
|
|
3936 | #define EV_CHILD_ENABLE 0 |
|
|
3937 | #define EV_ASYNC_ENABLE 0 |
|
|
3938 | #define EV_EMBED_ENABLE 0 |
3892 | |
3939 | |
3893 | =item EV_AVOID_STDIO |
3940 | =item EV_AVOID_STDIO |
3894 | |
3941 | |
3895 | If this is set to C<1> at compiletime, then libev will avoid using stdio |
3942 | If this is set to C<1> at compiletime, then libev will avoid using stdio |
3896 | functions (printf, scanf, perror etc.). This will increase the codesize |
3943 | functions (printf, scanf, perror etc.). This will increase the codesize |