function hsAllocScratch(db) {
  const scratchPtrPtr = ref.alloc(r(hsScratch), ref.NULL);
  const res = hyperscan.hs_alloc_scratch(db, scratchPtrPtr);
  console.log('Scratch allocation result:', res);
  // console.log(scratchPtrPtr);
  return scratchPtrPtr.deref();
}
/**
 * Allocates a scratch object for a database
 * @param {hsDatabase} db The database for which to allocate a scratch
 * @returns {hsScratch} Allocated scratch object
 */
Allocates a scratch object for a database
@param {hsDatabase} db The database for which to allocate a scratch
@returns {hsScratch} Allocated scratch object
Allocates a scratch object for a database @param { hsDatabase } db The database for which to allocate a scratch @returns { hsScratch } Allocated scratch object
function hsAllocScratch(db) {
  const scratchPtrPtr = ref.alloc(r(hsScratch), ref.NULL);
  const res = hyperscan.hs_alloc_scratch(db, scratchPtrPtr);
  console.log('Scratch allocation result:', res);
  return scratchPtrPtr.deref();
}
function hsAllocScratch ( db ) { const scratchPtrPtr = ref . alloc ( r ( hsScratch ) , ref . NULL ) ; const res = hyperscan . hs_alloc_scratch ( db , scratchPtrPtr ) ; console . log ( 'Scratch allocation result:' , res ) ; return scratchPtrPtr . deref ( ) ; }
Allocates a scratch object for a database
 @param {hsDatabase} db The database for which to allocate a scratch
 @returns {hsScratch} Allocated scratch object
Allocates a scratch object for a database @param { hsDatabase } db The database for which to allocate a scratch @returns { hsScratch } Allocated scratch object
// console.log(scratchPtrPtr);