Skip to content

MPR#7652: Restore accidentally hidden functions in misc.h#1442

Merged
gasche merged 1 commit intoocaml:trunkfrom
murmour:restore-strdup
Oct 26, 2017
Merged

MPR#7652: Restore accidentally hidden functions in misc.h#1442
gasche merged 1 commit intoocaml:trunkfrom
murmour:restore-strdup

Conversation

@murmour
Copy link
Contributor

@murmour murmour commented Oct 23, 2017

These compatibility aliases were accidentally moved into CAML_INTERNALS in #71.

Fixes MPR#7652.

These compatibility aliases were accidentally moved into CAML_INTERNALS in GPR#71.
@dra27
Copy link
Member

dra27 commented Oct 24, 2017

I don't think this fix is correct - existing 3rd party code which calls caml_strdup will use free, not caml_stat_free and so break, I think?

@gasche
Copy link
Member

gasche commented Oct 24, 2017

My understanding was that caml_stat_free is only required when the runtime is explicitly started with caml_startup_pooled, and then the behavior that you ( @dra27 ) descibe looks correct to me: in this not-the-default mode we want legacy code to break so that it is fixed to preserve the desired invariants.

@murmour
Copy link
Contributor Author

murmour commented Oct 24, 2017

@gasche is correct: if the runtime is not started with caml_startup_pooled, then no breakage should occur. The end user should experience no regressions, unless he explicitly chooses the new pooling mode.

From a comment in memory.h: "If the pool is not initialized, [caml_stat_*] functions will still work in backward compatibility mode, becoming thin wrappers around [malloc] family of functions".

@damiendoligez damiendoligez added this to the 4.06.0 milestone Oct 24, 2017
Copy link
Member

@damiendoligez damiendoligez left a comment

Choose a reason for hiding this comment

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

The change is obviously correct.

@dra27
Copy link
Member

dra27 commented Oct 24, 2017

Ah, gotcha - I had overlooked/forgotten the difference between normal startup and caml_startup_pooled. Perhaps the Changes entry for GPR#71 could be updated to include this GPR, just for any future reference?

My only other thought is if we want to do anything with warning pragmas to show the deprecation, but I expect that we don't want to do that, at this stage, for 4.06.0?

@gasche gasche merged commit a076cbb into ocaml:trunk Oct 26, 2017
@gasche
Copy link
Member

gasche commented Oct 26, 2017

Merged in trunk, cherry-picked in 4.06 ( 84a29f4 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants