github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/src/runtime/ppapi/array_output_nacl.go (about)

     1  // Copyright 2014 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package ppapi
     6  
     7  type arrayOutputBuffer struct {
     8  	buffer      []byte
     9  	count, size uint32
    10  }
    11  
    12  func get_array_output_buffer(alloc *arrayOutputBuffer, count uint32, size uint32) *byte {
    13  	alloc.count = count
    14  	alloc.size = size
    15  	if count == 0 || size == 0 {
    16  		return nil
    17  	}
    18  	alloc.buffer = make([]byte, count*size)
    19  	return &alloc.buffer[0]
    20  }