Skip to content

Clarify (or fix) the semantics of Oo.id #5436

@vicuna

Description

@vicuna

Original bug ID: 5436
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2013-08-31T10:48:51Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @protz @dbuenzli

Bug description

It should be clarified how Oo.id behaves in the following cases:

  • Multi-threaded program: is it guaranteed that two different threads cannot create objects with the same id (I think so).

  • Serialized objects: currently, unmarshaling does not assign fresh ids to objects. It is thus possible to have two different objects in the same run of the program. Shouldn't unmarshaling reassign ids instead? One could then make clear in the documentation that Oo.id (and thus, generic hash/comparison) is not stable across "marshaling" boundaries, but at least one would keep the uniqueness property.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions