Giter Site home page Giter Site logo

luamimalloc's Introduction

Instructions

  • Make sure you have Visual Studio 2017 or 2019 installed with C++ build tools

  • Clone and build mimalloc (https://github.com/microsoft/mimalloc) and Lua 5.1 (https://www.lua.org/ftp/lua-5.1.5.tar.gz) in the parent directory, as static libraries

    • To build Lua 5.1 in Visual Studio, create a DLL project, add all files in src/, and delete luac.c
  • Build LuaMimalloc.dll (this project)

  • Copy the built .dll and Z_LuaMimallocLoader.lua to Saved Games/DCS_server/Scripts/Hooks

  • To enable the use of the custom allocator in missions, the mission environment also needs to be unsanitized on the server (edit Program Files/Eagle Dynamics/DCS World Dedicated Server/Scripts/MissionScripting.lua)

  • Optional: enable the allocator in Export scripts by adding the following to the start of Saved Games/Scripts/Export.lua:

xpcall(function()
    package.cpath = package.cpath..";"..lfs.writedir().."/Scripts/Hooks/?.dll"
    require("LuaMimalloc")
    log.write("Export.lua", log.INFO, "LuaMimalloc.dll loaded")
end, function(err)
    log.write("Export.lua", log.ERROR, "Failed to load LuaMimalloc.dll: "..tostring(err))
end)

Note: build paths are set up for x64 only

Known issues

  • The loader lua needs to start with Z to make sure it runs after Tacview, otherwise Tacview fails to load its own DLL for unknown reasons

luamimalloc's People

Contributors

ricmzn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.