scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit 36ff234d95c5489a4814ef68c5928bf1de598d42
parent 5302d5272a7dbe0823fc64220a549420e8f74937
Author: sin <sin@2f30.org>
Date:   Wed Jul 24 18:43:45 +0300

No need to call free on the old pointer, just alter the state directly

Diffstat:
alloc.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alloc.c b/alloc.c @@ -61,7 +61,7 @@ realloc(void *oldp, size_t nbytes) if (chunks[i].base == oldp) { n = chunks[i].size < nbytes ? chunks[i].size : nbytes; memcpy(p, chunks[i].base, n); - free(oldp); + chunks[i].state = FREE; return p; } }