Add automatic memory manager

24 views
Skip to first unread message

Ryan Gonzalez

unread,
Jan 25, 2014, 6:18:32 PM1/25/14
to asmji...@googlegroups.com
Manually freeing assembled functions is dangerous. It's aggravating to manually manage memory, and it's not exception safe. I propose an automatic function holder. Something like this:

AsmJit::AutoFunc<FunctionType> f{my_assembler.make()};
...
f.call(my_args);
// Function deleted when it goes out of slope

--
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."

Reply all
Reply to author
Forward
0 new messages