ev_set_allocator takes signed size

Marc Lehmann schmorp at schmorp.de
Mon Mar 18 19:01:48 CET 2019


On Mon, Mar 18, 2019 at 11:28:11AM +1300, Samuel Williams <space.ship.traveller at gmail.com> wrote:
> Is there some reason why ev_set_allocator is defined as:

If I remember correctly, this was because size_t and ssize_t were not very
portable.

> Because this produces warnings when trying to use `realloc` style
> functions, defined as:

Well, "relloc style functions" is a rather fuzzy set - if you limit
yourself to realloc functions only, then this is probably a good thing,
as the semantic of a large number of realloc functions is not of the
required type, so you probably need a wrapper in any case to work around
incompatibilities (for example, libev itself uses such a wrapper by
default, called ev_realloc_emul).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list