Skip to content

Commit

Permalink
- ふかうら王、memcpyにstd::つけ忘れてたの修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
yaneurao committed Feb 6, 2024
1 parent bea2af4 commit e027d26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/engine/dlshogi-engine/UctSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ namespace dlshogi
// rootPosはスレッドごとに用意されたもので、呼び出し元にインスタンスが存在しているので、
// 単純なコピーで問題ない。
Position pos;
memcpy(&pos, &rootPos, sizeof(Position));
std::memcpy(&pos, &rootPos, sizeof(Position));

// 1回プレイアウトする
visitor_batch.emplace_back();
Expand Down
3 changes: 2 additions & 1 deletion source/engine/dlshogi-engine/dlshogi_searcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#if defined(YANEURAOU_ENGINE_DEEP)

#include <sstream> // stringstream
#include <cstring> // memcpy

#include "dlshogi_types.h"
#include "UctSearch.h"
Expand Down Expand Up @@ -826,7 +827,7 @@ namespace dlshogi
{
// rootPosはスレッドごとに用意されているのでmemcpyして問題ない。
Position pos;
memcpy(&pos, &rootPos, sizeof(Position));
std::memcpy(&pos, &rootPos, sizeof(Position));
StateInfo si;

Move m1 = uct_child[best_i ].move;
Expand Down

0 comments on commit e027d26

Please sign in to comment.