Toward making MEOS thread safe#762
Open
estebanzimanyi wants to merge 11 commits intoMobilityDB:masterfrom
Open
Toward making MEOS thread safe#762estebanzimanyi wants to merge 11 commits intoMobilityDB:masterfrom
estebanzimanyi wants to merge 11 commits intoMobilityDB:masterfrom
Conversation
Davichet-e
reviewed
Mar 21, 2026
Member
Davichet-e
left a comment
There was a problem hiding this comment.
I think it looks good, happy to see this change happening. I only have a couple of small questions
| { | ||
| SPATIAL_REF_SYS_CSV = malloc(strlen(path) + 1); | ||
| strcpy(SPATIAL_REF_SYS_CSV, path); | ||
| SPATIAL_REF_SYS_CSV = strdup(path); |
Member
There was a problem hiding this comment.
nitpicking: If the user calls this function more than once, I think we would be leaking memory since we're not freeing the previous value, I would either document it or free the value if it was already initialized
Comment on lines
+531
to
+532
| item->last_used = ++cache->clock; | ||
| return item->projection; |
Member
There was a problem hiding this comment.
Shouldn't we update last_index too? If not, we will never enter the fast-path
Suggested change
| item->last_used = ++cache->clock; | |
| return item->projection; | |
| item->last_used = ++cache->clock; | |
| cache->last_index = i; | |
| return item->projection; |
| cache->items[pos].srid_from = srid_from; | ||
| cache->items[pos].srid_to = srid_to; | ||
| cache->items[pos].projection = projection; | ||
| cache->items[pos].last_used = ++cache->clock; |
Member
There was a problem hiding this comment.
I think we should update last_index too
Suggested change
| cache->items[pos].last_used = ++cache->clock; | |
| cache->items[pos].last_used = ++cache->clock; | |
| cache->last_index = pos; |
Comment on lines
567
to
568
| meos_error(ERROR, MEOS_ERR_INTERNAL_ERROR, | ||
| "got NULL for SRID (%d)", srid_from); |
Member
There was a problem hiding this comment.
Aren't we missing a return NULL here? If not we call meos_error but we continue executing I think
5262b86 to
21a3598
Compare
663e5f0 to
b3bfabc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step to make MEOS library thread safe
See Issue #404