AccountsSharedData: data copy on write (#15800)

* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
This commit is contained in:
Jeff Washington (jwash)
2021-03-23 15:19:31 -05:00
committed by GitHub
parent 6f5d8d18e9
commit 2d24d13046
3 changed files with 22 additions and 25 deletions

View File

@ -1559,8 +1559,9 @@ mod tests {
}
fn truncate_data(account: &mut AccountSharedData, len: usize) {
// when account data becomes copy on write, this operation will be more complicated
account.data.truncate(len);
let mut data = account.data.to_vec();
data.truncate(len);
account.set_data(data);
}
#[test]