by anc2020 · 15y ago · 0 comments
Having said that, malloc is a bad idea and completely unnecessary, and a nicer way to do the functionality might be to do:
function pmk(val) { return { v: val }; }
function pget(p) { return p.v; }
function pset(p, val) { return p.v = val; }
Doesn't need free'ing, at the minimal expense of creating one object per "pointer".Neither of the solutions give you an "address of" type behaviour though :(
No comments yet.