Clean up some of the threading code

This commit is contained in:
Justine Tunney 2022-09-08 11:54:56 -07:00
parent 0547eabcd6
commit 9f963dc597
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
62 changed files with 175 additions and 582 deletions

View file

@ -17,7 +17,6 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/intrin/kprintf.h"
#include "libc/intrin/likely.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/gc.internal.h"
@ -72,10 +71,7 @@ static void DeferFunction(struct StackFrame *frame, void *fn, void *arg) {
if (!(g = malloc(sizeof(struct Garbages)))) notpossible;
g->i = 0;
g->n = 4;
if (!(g->p = malloc(g->n * sizeof(struct Garbage)))) {
kprintf("malloc failed\n");
notpossible;
}
if (!(g->p = malloc(g->n * sizeof(struct Garbage)))) notpossible;
tls->garbages = g;
} else if (UNLIKELY(g->i == g->n)) {
p2 = g->p;