Browse Source

*** empty log message ***

master
Marc Alexander Lehmann 2 years ago
parent
commit
9c2c08ed07
  1. 1
      Changes
  2. 22
      ev.pod

1
Changes

@ -1,6 +1,7 @@
Revision history for libev, a high-performance and full-featured event loop.
- removed redundant 0-ptr check in ev_once.
- updated/extended ev_set_allocator documentation.
4.25 Fri Dec 21 07:49:20 CET 2018
- INCOMPATIBLE CHANGE: EV_THROW was renamed to EV_NOEXCEPT

22
ev.pod

@ -267,12 +267,32 @@ You could override this function in high-availability programs to, say,
free some memory if it cannot allocate memory, to use a special allocator,
or even to sleep a while and retry until some memory is available.
Example: The following is the C<realloc> function that libev itself uses
which should work with C<realloc> and C<free> functions of all kinds and
is probably a good basis for your own implementation.
static void *
ev_realloc_emul (void *ptr, long size) EV_NOEXCEPT
{
if (size)
return realloc (ptr, size);
free (ptr);
return 0;
}
Example: Replace the libev allocator with one that waits a bit and then
retries (example requires a standards-compliant C<realloc>).
retries.
static void *
persistent_realloc (void *ptr, size_t size)
{
if (!size)
{
free (ptr);
return 0;
}
for (;;)
{
void *newptr = realloc (ptr, size);

Loading…
Cancel
Save