Skip to content

Commit

Permalink
Up-to-date with fast_obj (1a80602)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwoffenden committed Jun 15, 2023
1 parent 5738b7d commit dae309d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions inc/fast_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,14 @@ static void* array_realloc(void* ptr, fastObjUInt n, fastObjUInt b)
fastObjUInt sz = array_size(ptr);
fastObjUInt nsz = sz + n;
fastObjUInt cap = array_capacity(ptr);
fastObjUInt ncap = 3 * cap / 2;
fastObjUInt ncap = cap + cap / 2;
fastObjUInt* r;


if (ncap < nsz)
ncap = nsz;
ncap = (ncap + 15) & ~15u;

r = (fastObjUInt*)(memory_realloc(ptr ? _array_header(ptr) : 0, b * ncap + 2 * sizeof(fastObjUInt)));
r = (fastObjUInt*)(memory_realloc(ptr ? _array_header(ptr) : 0, (size_t)b * ncap + 2 * sizeof(fastObjUInt)));
if (!r)
return 0;

Expand Down

0 comments on commit dae309d

Please sign in to comment.