shithub: moonfish

Download patch

ref: 9222d0b35ad2dada41fa4db9d29a6586aeba6e8e
parent: 1b584e2675da7dd15ce5d53173b4add277b62b61
author: zamfofex <zamfofex@twdb.moe>
date: Fri May 3 07:27:03 EDT 2024

remove ‘moonfish_free’

--- a/main.c
+++ b/main.c
@@ -241,6 +241,9 @@
 		fflush(stdout);
 	}
 	
-	moonfish_free(analysis);
+#ifndef moonfish_mini
+	free(analysis);
+#endif
+	
 	return 0;
 }
--- a/moonfish.h
+++ b/moonfish.h
@@ -76,7 +76,6 @@
 
 struct moonfish_analysis *moonfish_analysis(char *argv0);
 void moonfish_new(struct moonfish_analysis *analysis, struct moonfish_chess *chess);
-void moonfish_free(struct moonfish_analysis *analysis);
 
 void moonfish_from_uci(struct moonfish_chess *chess, struct moonfish_move *move, char *name);
 void moonfish_to_uci(char *name, struct moonfish_move *move);
--- a/search.c
+++ b/search.c
@@ -116,13 +116,6 @@
 	analysis->time = -1;
 }
 
-void moonfish_free(struct moonfish_analysis *analysis)
-{
-	struct moonfish_chess chess = {0};
-	moonfish_new(analysis, &chess);
-	free(analysis);
-}
-
 static int moonfish_search(struct moonfish_info *info, int alpha, int beta, int depth, long int t0, long int time)
 {
 	int score;
--