… | |
… | |
305 | might be supported on the current system, you would need to look at |
305 | might be supported on the current system, you would need to look at |
306 | \&\f(CW\*(C`ev_embeddable_backends () & ev_supported_backends ()\*(C'\fR, likewise for |
306 | \&\f(CW\*(C`ev_embeddable_backends () & ev_supported_backends ()\*(C'\fR, likewise for |
307 | recommended ones. |
307 | recommended ones. |
308 | .Sp |
308 | .Sp |
309 | See the description of \f(CW\*(C`ev_embed\*(C'\fR watchers for more info. |
309 | See the description of \f(CW\*(C`ev_embed\*(C'\fR watchers for more info. |
310 | .IP "ev_set_allocator (void *(*cb)(void *ptr, size_t size))" 4 |
310 | .IP "ev_set_allocator (void *(*cb)(void *ptr, long size))" 4 |
311 | .IX Item "ev_set_allocator (void *(*cb)(void *ptr, size_t size))" |
311 | .IX Item "ev_set_allocator (void *(*cb)(void *ptr, long size))" |
312 | Sets the allocation function to use (the prototype and semantics are |
312 | Sets the allocation function to use (the prototype is similar \- the |
313 | identical to the realloc C function). It is used to allocate and free |
313 | semantics is identical \- to the realloc C function). It is used to |
314 | memory (no surprises here). If it returns zero when memory needs to be |
314 | allocate and free memory (no surprises here). If it returns zero when |
315 | allocated, the library might abort or take some potentially destructive |
315 | memory needs to be allocated, the library might abort or take some |
316 | action. The default is your system realloc function. |
316 | potentially destructive action. The default is your system realloc |
|
|
317 | function. |
317 | .Sp |
318 | .Sp |
318 | You could override this function in high-availability programs to, say, |
319 | You could override this function in high-availability programs to, say, |
319 | free some memory if it cannot allocate memory, to use a special allocator, |
320 | free some memory if it cannot allocate memory, to use a special allocator, |
320 | or even to sleep a while and retry until some memory is available. |
321 | or even to sleep a while and retry until some memory is available. |
321 | .Sp |
322 | .Sp |