예제 #1
0
static void caml_reallocate_extensible_buffer_if_needed(struct caml_extensible_buffer *b, size_t new_used_size){
  size_t new_allocated_size = b->allocated_size;

  while(new_allocated_size < new_used_size)
    new_allocated_size = new_allocated_size * 2 + 8;
  caml_reallocate_extensible_buffer(b, new_allocated_size);
}
예제 #2
0
static void caml_reallocate_extensible_buffer_if_needed(struct caml_extensible_buffer *b, size_t new_used_size){
  while(new_used_size > b->allocated_size)
    caml_reallocate_extensible_buffer(b, b->allocated_size * 2 + 1);
}