You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1399 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Ok, so I think that I now have a bug report. In the file
otherlibs/db/dbstubs.c in the distribution, the following definitions
can be found:
These are allocated as finalized blocks, but my understanding is that
finalized blocks and custom blocks now have the same format, so this
code looks wrong. I don't think this code is actually compiled into the
distribution, but it seems like it should either be removed, fixed, or
at least marked as buggy somehow so someone doesn't try to use it as a
model for new code, as I did.
Thanks,
y
On Fri, 2002-09-20 at 05:56, Xavier Leroy wrote:
I'm wondering if someone can help me out in understanding the difference
between Bp_val and Data_custom_val.
Caml heap blocks are composed of a GC header and a number of words of data.
Bp_val points to the first word of data:
header data0 data1 data2 ...
^
|
Bp_val
For finalized and custom blocks, the first word of "data" holds a
pointer to a record of functions (finalization functions, comparison
functions, etc), and Data_custom_val points to the second word of data,
i.e. the beginning of the user data space:
header function data1 data2 ...
pointer
^
|
Data_custom_val
This is incorrect, you should use Data_custom_val(v) instead of
Bp_val(v), otherwise the db field will overwrite the function pointer
at the beginning of the custom/finalized block.
Original bug ID: 1399
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Ok, so I think that I now have a bug report. In the file
otherlibs/db/dbstubs.c in the distribution, the following definitions
can be found:
#define Camldb_db(v) (((struct camldb *)(Bp_val(v)))->db)
#define Camldb_info(v) (((struct camldb *)(Bp_val(v)))->info)
#define Camldb_closed(v) (((struct camldb *)(Bp_val(v)))->closed)
These are allocated as finalized blocks, but my understanding is that
finalized blocks and custom blocks now have the same format, so this
code looks wrong. I don't think this code is actually compiled into the
distribution, but it seems like it should either be removed, fixed, or
at least marked as buggy somehow so someone doesn't try to use it as a
model for new code, as I did.
Thanks,
y
On Fri, 2002-09-20 at 05:56, Xavier Leroy wrote:
Open PGP --- KeyID B1FFD916 (new key as of Dec 4th)
Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916
The text was updated successfully, but these errors were encountered: