add comment about zero-copy in space chapter

This commit is contained in:
Paul Schaaf 2022-03-23 18:12:34 -04:00
parent f13166d17c
commit 1193965b92
No known key found for this signature in database
GPG Key ID: 832D12D4356B4331
1 changed files with 2 additions and 0 deletions

View File

@ -1,6 +1,8 @@
# Space Reference
This reference tells you how much space you should allocate for an account.
This only applies to accounts that don't use `zero-copy`. `zero-copy` uses `repr(C)` with a pointer cast,
so there the `C` layout applies.
In addition to the space for the account data, you have to add `8` to the `space` constraint for Anchor's internal discriminator (see the example).