The Best Source For HiTech
In any language that supports deterministic destruction and the overloading of the copy constructor and the assignment operator it should be trivial. Or so I though until I decided to implement a simple ref-counted thread handle in D. Two problems popped up: .... setmetatable(result, {__gc = function (self) begin w32.CloseHandle(self.__id); end}); end. This is supposed to be pseudo-Lua, I hope it makes sense. It's so simple that I'm wondering if I miss something here… ...
See the article here:
The Anatomy of Reference Counting « Bartosz Milewski's Programming ...
We're the best source for HiTech information
Leave a reply