export { Float32ArrayPool as Float32Array };

import { Root } from "./Pool_Base.js";

/**
 * Providing Array by specifying length.
 *
 */
class Float32ArrayPool extends Root {
  
  constructor() {
    super( Float32Array, Float32ArrayPool.setAsConstructor_by_length );
  }

  /**
   * @param {Array} this
   *   The array object to be set length.
   *
   * @param {number} newLength
   *   The this.length to be set to newLength.
   */
  static setAsConstructor_by_length( newLength ) {
    
//!!! ...unfinished... (2022/06/21) adjust ArrayBuffer.
    this.length = newLength;
  }

}

@@ -96,16 +96,23 @@
 oviding 
+Float32
 Array by
@@ -134,16 +134,100 @@
 gth.%0A *%0A
+ * It will try to re-use Float32Array or its underlying ArrayBuffer as possible.%0A *%0A
  */%0Aclas
@@ -510,24 +510,394 @@
  newLength.%0A
+   *%0A   * @return %7BFloat32Array%7D%0A   *   Return a Float32Array object.%0A   *   - If this.length is the same as required, it will be returned directly.%0A   *   - Otherwise, if this.buffer is large enough, it will be used to create (and return) a new Float32Array object.%0A   *   - Otherise, a new ArrayBuffer will be created to create (and return) a new Float32Array object.%0A
    */%0A  stat
@@ -945,96 +945,511 @@
 ) %7B%0A
+%0A
     
-%0A
 //
-!!! ...unfinished... (2022/06/21) adjust ArrayBuffer.%0A    this.length = newLength
+ 1.%0A    if ( this.length == newLength )%0A      return this;%0A%0A    // 2.%0A    let arrayBuffer;%0A    %7B%0A      let newByteLength = newLength * Float32Array.BYTES_PER_ELEMENT;%0A      if ( this.buffer.byteLength %3E= newByteLength )%0A        arrayBuffer = this.buffer;%0A      else%0A        arrayBuffer = new ArrayBuffer( newByteLength ); // Create new buffer when old buffer is not large enough.%0A    %7D%0A%0A    // 3.%0A    let newFloat32Array = new Float32Array( arrayBuffer, 0, newLength );%0A    return newFloat32Array
 ;%0A  

Update Pool_Float32Array.js