Closed alexanderMathew closed 1 month ago
This doesn't implement the correct/expected functionality. While it might work in most cases, it doesn't correspond to the description of the function in the comments. In particular, if the given capacity is smaller than the current size, the function should automatically resize the DynArray to have size corresponding to the new given capacity. With your edit, the function can no longer be used to reduce the size of the DynArray container at all, which is not right either.
https://github.com/microsoft/SEAL/issues/693#issue-2337681575
Added a check in [/native/src/seal/dynarray.h] to see if capacity > capacity_ before memory allocation