import { Type , TypedArray , typedArray , TypedArrayTypeMap , } from "@thi.ng/api/typedarray" ; import type { IMemPoolArray } from "./api.js" ; /**
 * Stub/polyfill implementation of  IMemPoolArray , merely delegating to
 * JS typed array ctors with no further management of returned arrays.
  export class NativePool implements IMemPoolArray { mallocAs < T extends Type > ( type , num ) { return typedArray ( type , num ) ; } callocAs < T extends Type > ( type , num , fill = 0 ) { return < any > typedArray ( type , num ) . fill ( fill ) ; } reallocArray < T extends TypedArray > ( src , num ) { if ( num === src . length ) return src ; const dest = new ( < any > src . constructor ) ( num ) ; dest . set ( src . subarray ( 0 , Math . min ( src . length , num ) ) ) ; return dest ; } free ( _ ) { return true ; } freeAll ( ) { } release ( ) { return true ; } }