Skip to content

Can I overallocate CPaths for reuse or for use in builders? #931

Closed Answered by schellingerhout
schellingerhout asked this question in Q&A
Discussion options

You must be logged in to vote

I believe the answer to my original question is "yes", since the conversion code does not read the value, but calculates "A" for output. However, since things may change in the future, and I don't want to depend on the way the code is written I rather use a negative offset pointer for capacity.

Here is my solution with a negative offset record TPathsHiddenFields stored before TPaths.. If you are interested in what I did here, it's a simplified version of

https://github.com/AngusJohnson/Clipper2/blob/65bcbf95e5bbd279fe469af1ab83365a336bae83/DLL/Delphi_interface/Clipper.DLL.Data.pas

Angus declined that change due to support for older versions of Delphi without generics. Since I will never u…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@schellingerhout
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by schellingerhout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants