ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.50 by root, Tue Nov 27 10:59:11 2007 UTC vs.
Revision 1.52 by root, Tue Nov 27 19:41:52 2007 UTC

115C<ev_embeddable_backends () & ev_supported_backends ()>, likewise for 115C<ev_embeddable_backends () & ev_supported_backends ()>, likewise for
116recommended ones. 116recommended ones.
117 117
118See the description of C<ev_embed> watchers for more info. 118See the description of C<ev_embed> watchers for more info.
119 119
120=item ev_set_allocator (void *(*cb)(void *ptr, long size)) 120=item ev_set_allocator (void *(*cb)(void *ptr, size_t size))
121 121
122Sets the allocation function to use (the prototype is similar to the 122Sets the allocation function to use (the prototype and semantics are
123realloc C function, the semantics are identical). It is used to allocate 123identical to the realloc C function). It is used to allocate and free
124and free memory (no surprises here). If it returns zero when memory 124memory (no surprises here). If it returns zero when memory needs to be
125needs to be allocated, the library might abort or take some potentially 125allocated, the library might abort or take some potentially destructive
126destructive action. The default is your system realloc function. 126action. The default is your system realloc function.
127 127
128You could override this function in high-availability programs to, say, 128You could override this function in high-availability programs to, say,
129free some memory if it cannot allocate memory, to use a special allocator, 129free some memory if it cannot allocate memory, to use a special allocator,
130or even to sleep a while and retry until some memory is available. 130or even to sleep a while and retry until some memory is available.
131 131
132Example: replace the libev allocator with one that waits a bit and then 132Example: replace the libev allocator with one that waits a bit and then
133retries: better than mine). 133retries: better than mine).
134 134
135 static void * 135 static void *
136 persistent_realloc (void *ptr, long size) 136 persistent_realloc (void *ptr, size_t size)
137 { 137 {
138 for (;;) 138 for (;;)
139 { 139 {
140 void *newptr = realloc (ptr, size); 140 void *newptr = realloc (ptr, size);
141 141
1997 1997
1998If you need to shave off some kilobytes of code at the expense of some 1998If you need to shave off some kilobytes of code at the expense of some
1999speed, define this symbol to C<1>. Currently only used for gcc to override 1999speed, define this symbol to C<1>. Currently only used for gcc to override
2000some inlining decisions, saves roughly 30% codesize of amd64. 2000some inlining decisions, saves roughly 30% codesize of amd64.
2001 2001
2002=item EV_PID_HASHSIZE
2003
2004C<ev_child> watchers use a small hash table to distribute workload by
2005pid. The default size is C<16> (or C<1> with C<EV_MINIMAL>), usually more
2006than enough. If you need to manage thousands of children you might want to
2007increase this value.
2008
2002=item EV_COMMON 2009=item EV_COMMON
2003 2010
2004By default, all watchers have a C<void *data> member. By redefining 2011By default, all watchers have a C<void *data> member. By redefining
2005this macro to a something else you can include more and other types of 2012this macro to a something else you can include more and other types of
2006members. You have to define it each time you include one of the files, 2013members. You have to define it each time you include one of the files,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines