本文整理汇总了C++中Assembly::freeByteCode方法的典型用法代码示例。如果您正苦于以下问题:C++ Assembly::freeByteCode方法的具体用法?C++ Assembly::freeByteCode怎么用?C++ Assembly::freeByteCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assembly
的用法示例。
在下文中一共展示了Assembly::freeByteCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LSMapFile
Assembly *LSLuaState::loadExecutableAssembly(const utString& assemblyName, bool absPath)
{
// executables always in bin
utString filePath;
if (!absPath)
{
filePath = "./bin/";
}
filePath += assemblyName;
if (!strstr(filePath.c_str(), ".loom"))
{
filePath += ".loom";
}
const char *buffer = NULL;
long bufferSize;
LSMapFile(filePath.c_str(), (void **)&buffer, &bufferSize);
lmAssert(buffer && bufferSize, "Error loading executable: %s, unable to map file", assemblyName.c_str());
Assembly* assembly = loadExecutableAssemblyBinary(buffer, bufferSize);
LSUnmapFile(filePath.c_str());
lmAssert(assembly, "Error loading executable: %s", assemblyName.c_str());
assembly->freeByteCode();
return assembly;
}
示例2: loadBytes
int Assembly::loadBytes(lua_State *L) {
utByteArray *bytes = static_cast<utByteArray*>(lualoom_getnativepointer(L, 1, false, "system.ByteArray"));
Assembly *assembly = LSLuaState::getExecutingVM(L)->loadExecutableAssemblyBinary(static_cast<const char*>(bytes->getDataPtr()), bytes->getSize());
lmAssert(assembly, "Error loading assembly bytes");
lualoom_pushnative(L, assembly);
assembly->freeByteCode();
return 1;
}