Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1199: Remove the vestigal traces of custom memory allocators, part 1, updated #11

Closed
wants to merge 1 commit into from

Conversation

jimregan
Copy link
Contributor

  1. memry removal.

This should be no-brainer. These functions never seemed to do anything useful. The only oddity was with alloc_string which rounded the allocation upwards to nearest multiple of 4. Based on my review of code, I could not identify any value in this feature, so even alloc_string was simply transformed to malloc.

memry.* are removed. All code is adjusted to simply call malloc and free instead.

listio.* are removed. The list reading function in these files appears to have been unused, and contained the only invocation of strsave define, which was one of the alloc_string users, so I removed both of them.

https://code.google.com/p/tesseract-ocr/issues/detail?id=1199

1. memry removal.

This should be no-brainer. These functions never seemed to do anything useful. The only oddity was with alloc_string which rounded the allocation upwards to nearest multiple of 4. Based on my review of code, I could not identify any value in this feature, so even alloc_string was simply transformed to malloc.

memry.* are removed. All code is adjusted to simply call malloc and free instead.

listio.* are removed. The list reading function in these files appears to have been unused, and contained the only invocation of strsave define, which was one of the alloc_string users, so I removed both of them.

https://code.google.com/p/tesseract-ocr/issues/detail?id=1199
@tfmorris
Copy link
Contributor

Archive copy of issue (but full text is included above): https://web.archive.org/web/20151128081631/http://code.google.com/p/tesseract-ocr/issues/detail?id=1199

Copy link
Contributor

@theraysmith theraysmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change overall apart from one thing:
Introducing calls to malloc and free is a backwards step.
How about replacing the underlying pointer variables with std::array, thus hiding all calls to allocate and delete the memory?

@amitdo amitdo mentioned this pull request Dec 9, 2016
amitdo referenced this pull request May 3, 2017
Remove freelist,c and freelist.h
@amitdo
Copy link
Collaborator

amitdo commented Sep 25, 2017

@zdenop, please close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants