package brotli

/* Copyright 2016 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/*
Dynamically grows array capacity to at least the requested size
T: data type
A: array
C: capacity
R: requested size
*/
func brotli_ensure_capacity_uint8_t( *[]byte,  *uint,  uint) {
	if * <  {
		var  uint = *
		if  == 0 {
			 = 
		}

		for  <  {
			 *= 2
		}

		if cap(*) < int() {
			var  []byte = make([]byte, )
			if * != 0 {
				copy(, (*)[:*])
			}

			* = 
		} else {
			* = (*)[:]
		}

		* = 
	}
}

func brotli_ensure_capacity_uint32_t( *[]uint32,  *uint,  uint) {
	var  []uint32
	if * <  {
		var  uint = *
		if  == 0 {
			 = 
		}

		for  <  {
			 *= 2
		}

		if cap(*) < int() {
			 = make([]uint32, )
			if * != 0 {
				copy(, (*)[:*])
			}

			* = 
		} else {
			* = (*)[:]
		}
		* = 
	}
}