Skip to content

Commit

Permalink
Fix regression in package.ape build tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Sep 17, 2024
1 parent b1c9801 commit 8201ef2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libc/runtime/grow.c → libc/mem/grow.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "ape/sections.internal.h"
#include "libc/assert.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/weaken.h"
#include "libc/macros.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
Expand Down Expand Up @@ -53,7 +52,7 @@ bool __grow(void *pp, size_t *capacity, size_t itemsize, size_t extra) {
n1 = *capacity;
n2 = (*p ? n1 + (n1 >> 1) : MAX(4, INITIAL_CAPACITY / itemsize)) + extra;
if (!ckd_mul(&t1, n1, itemsize) && !ckd_mul(&t2, n2, itemsize)) {
if (_weaken(realloc) && (p2 = _weaken(realloc)(p1, ROUNDUP(t2, 32)))) {
if ((p2 = realloc(p1, ROUNDUP(t2, 32)))) {
if (!p1 && *p)
memcpy(p2, *p, t1);
bzero((char *)p2 + t1, t2 - t1);
Expand Down

0 comments on commit 8201ef2

Please sign in to comment.