fnuecke / eris

Heavy Duty Persistence for Lua 5.2 and 5.3
Other
169 stars 23 forks source link

Literal persistance of userdata #3

Closed ghost closed 11 years ago

ghost commented 11 years ago

The docs state the a userdata with a metatable which has a key of __persist and value of true: marks the object for literal persistence. This is the default for tables. Trying to literally persist userdata without this will result in an error. If set, however, the userdata's memory block will be written as-is, and read back as-is.

Yet it seems the code also tries to read the metatable, rather than just the userdata block.

fnuecke commented 11 years ago

Hmm, maybe the wording is a little unclear. Further up in the text it says "for tables and userdata, metatables are also persisted", which is indeed the intent for normal persistence. The metatable is only omitted when using special persistence. So it is working as intended. I'll try to make that more clear in the part of the readme you quote from.