nl_tokens: Subtracts the amount needed for memory usage from runState . gasLeft
pl_tokens: function subMemUsage ( runState , offset , length ) { // YP (225): access with zero length will not extend the memory if ( length . isZero ( ) ) return const newMemoryWordCount = offset . add ( length ) . divCeil ( new BN ( 32 ) ) if ( newMemoryWordCount . lte ( runState . memoryWordCount ) ) return const <mask> = newMemoryWordCount const fee = new BN ( runState . _common . param ( 'gasPrices' , 'memory' ) ) const quadCoeff = new BN ( runState . _common . param ( 'gasPrices' , 'quadCoeffDiv' ) ) // words * 3 + words ^2 / 512 const cost = words . mul ( fee ) . add ( words . mul ( words ) . div ( quadCoeff ) ) if ( cost . gt ( runState . highestMemCost ) ) { subGas ( runState , cost . sub ( runState . highestMemCost ) ) runState . highestMemCost = cost } runState . memoryWordCount = newMemoryWordCount }