When calling GetAllocatedSize() on a TBitArray it will round down the result of MaxBits / NumBitsPerDWORD. This means that not enough bytes are allocated when the MaxBits is not divisible by NumBitsPerDWORD(32).
1. Open UE4Editor (any project)
2. Create class based on Actor (MyActor)
3. In MyActor.h add the following:
4. Add #include "Engine.h" to MyActor.cpp
5. In MyActor.cpp add the following:
6. Compile the MyActor class
7. Create a blueprint based on MyActor (MyActorBP)
8. Add instance of MyActorBP to the level
9. Set the value of ArrayMax to 600 in the details panel
10. Play in editor
72 will be printed out on screen (Number of bytes allocated for the bit array). An array of 600 bits would need 76 bytes (608bits)
Head over to the existing Questions & Answers thread and let us know what's up.