Add BPF support & C-based BPF tic-tac-toe (#1422)

Add initial support for BPF and a C port of tictactoe
This commit is contained in:
jackcmay
2018-10-04 09:44:44 -07:00
committed by GitHub
parent 74b63c12a0
commit 13d4443d4d
27 changed files with 1321 additions and 124 deletions

View File

@@ -55,6 +55,7 @@ impl Default for State {
}
}
#[repr(C)]
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
pub struct Game {
player_x: Pubkey,
@@ -173,7 +174,8 @@ impl Game {
}
#[derive(Debug, Serialize, Deserialize)]
enum Command {
#[repr(C)]
pub enum Command {
Init, // player X initializes a new game
Join(i64), // player O wants to join (seconds since UNIX epoch)
KeepAlive(i64), // player X/O keep alive (seconds since UNIX epoch)