reallocSlotIfRequired method

void reallocSlotIfRequired(
  1. int slot,
  2. int length
)

Implementation

void reallocSlotIfRequired(int slot, int length) {
  if (isPointerNull(stringSlots[slot]) || stringCapacities[slot] < length) {
    if (!isPointerNull(stringSlots[slot])) freeFunc(pointerToSource(stringSlots[slot]));
    stringSlots[slot] = pointerFactory(allocatorFunc(length));
    stringCapacities[slot] = length;
  }
}