mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-14 09:50:05 +00:00
CPunch
e7265ad15b
- sLaika_pollList now holds an outQueue, if events are sent to a peer, the pollList will keep track so the caller (cnc, bot, etc) can handle each pollOut for the queued peers.
19 lines
435 B
C
19 lines
435 B
C
#include "lerror.h"
|
|
#include "lmem.h"
|
|
|
|
void *laikaM_realloc(void *buf, size_t sz) {
|
|
void *newBuf;
|
|
|
|
/* are we free'ing the buffer? */
|
|
if (sz == 0) {
|
|
if (buf != NULL) /* sanity check :) */
|
|
free(buf);
|
|
return NULL;
|
|
}
|
|
|
|
/* if NULL is passed, realloc() acts like malloc() */
|
|
if ((newBuf = realloc(buf, sz)) == NULL)
|
|
LAIKA_ERROR("failed to allocate memory!\n");
|
|
|
|
return newBuf;
|
|
} |