1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-14 09:50:05 +00:00
Laika/lib/src/lmem.c
CPunch e7265ad15b Added laikaP_pushOutQueue, minor refactoring
- 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.
2022-02-13 23:55:30 -06:00

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;
}