1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162[%%import"debug.mlh"]openCore_kernelincludeInt.Replace_polymorphic_compare(* All [assert]s and other checks throughout the code are guarded by [if debug]. The
DEBUG variable is set in the lib [incremental] and unset in the lib
[incremental_debug], but apart from that they are identical. Tests are run with both
the production and debug lib, and users can choose to build with the debug library, if
they suspect they found a bug in incremental. *)[%%ifJSC_DEBUG]letdebug=true[%%else]letdebug=false[%%endif]letconcat=String.concatlettagnameasexp_of_a=(name,a)|>[%sexp_of:string*a]moduleStep_function=Incremental_step_functionmoduleTime_ns=structincludeTime_nsletsexp_of_t=Time_ns.Alternate_sexp.sexp_of_tendmoduleArray=structincludeArray(* Not defining aliases in production mode, since they break type specialization of
array accesses. *)[%%ifJSC_DEBUG]letunsafe_get=getletunsafe_set=set[%%endif](* Requires [len >= length t]. *)letrealloct~lena=letnew_t=create~lenainArray.blit~src:t~src_pos:0~dst:new_t~dst_pos:0~len:(lengtht);new_t;;endmoduleUopt=structincludeUoptletunsafe_value=ifdebugthenvalue_exnelseunsafe_valueendmoduleAlarm_precision=Timing_wheel.Alarm_precision