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

Comparing libev/ev.c (file contents):
Revision 1.149 by root, Tue Nov 27 19:23:31 2007 UTC vs.
Revision 1.150 by root, Tue Nov 27 19:41:52 2007 UTC

253 perror (msg); 253 perror (msg);
254 abort (); 254 abort ();
255 } 255 }
256} 256}
257 257
258static void *(*alloc)(void *ptr, long size); 258static void *(*alloc)(void *ptr, size_t size) = realloc;
259 259
260void 260void
261ev_set_allocator (void *(*cb)(void *ptr, long size)) 261ev_set_allocator (void *(*cb)(void *ptr, size_t size))
262{ 262{
263 alloc = cb; 263 alloc = cb;
264} 264}
265 265
266static void * 266inline_speed void *
267ev_realloc (void *ptr, long size) 267ev_realloc (void *ptr, size_t size)
268{ 268{
269 ptr = alloc ? alloc (ptr, size) : realloc (ptr, size); 269 ptr = alloc (ptr, size);
270 270
271 if (!ptr && size) 271 if (!ptr && size)
272 { 272 {
273 fprintf (stderr, "libev: cannot allocate %ld bytes, aborting.", size); 273 fprintf (stderr, "libev: cannot allocate %ld bytes, aborting.", (long)size);
274 abort (); 274 abort ();
275 } 275 }
276 276
277 return ptr; 277 return ptr;
278} 278}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines