2019-07-08 17:15:34 -07:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2019-06-22 10:30:09 -07:00
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" />
< meta http-equiv = "X-UA-Compatible" content = "IE=9" />
2021-12-18 16:36:37 -08:00
< meta name = "generator" content = "Doxygen 1.9.1" />
2019-06-22 10:30:09 -07:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" />
< title > mi-malloc: Building</ title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" />
< script type = "text/javascript" src = "jquery.js" ></ script >
< script type = "text/javascript" src = "dynsections.js" ></ script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" />
< script type = "text/javascript" src = "resize.js" ></ script >
< script type = "text/javascript" src = "navtreedata.js" ></ script >
< script type = "text/javascript" src = "navtree.js" ></ script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" />
< script type = "text/javascript" src = "search/searchdata.js" ></ script >
< script type = "text/javascript" src = "search/search.js" ></ script >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$ ( document ). ready ( function () { init_search (); });
/* @license-end */
</ script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" />
< link href = "mimalloc-doxygen.css" rel = "stylesheet" type = "text/css" />
</ head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td id = "projectlogo" >< img alt = "Logo" src = "mimalloc-logo.svg" /></ td >
< td id = "projectalign" style = "padding-left: 0.5em;" >
< div id = "projectname" > mi-malloc
2021-12-18 16:36:37 -08:00
  < span id = "projectnumber" > 1.7/2.0</ span >
2019-06-22 10:30:09 -07:00
</ div >
</ td >
< td > < div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
2021-12-18 16:36:37 -08:00
< img id = "MSearchSelect" src = "search/mag_sel.svg"
2019-06-22 10:30:09 -07:00
onmouseover = "return searchBox.OnSearchSelectShow()"
onmouseout = "return searchBox.OnSearchSelectHide()"
alt = "" />
< input type = "text" id = "MSearchField" value = "Search" accesskey = "S"
2022-12-03 00:23:43 +01:00
onfocus = "searchBox.OnSearchFieldFocus(true)"
onblur = "searchBox.OnSearchFieldFocus(false)"
2019-06-22 10:30:09 -07:00
onkeyup = "searchBox.OnSearchFieldChange(event)" />
</ span >< span class = "right" >
2021-12-18 16:36:37 -08:00
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" >< img id = "MSearchCloseImg" border = "0" src = "search/close.svg" alt = "" /></ a >
2019-06-22 10:30:09 -07:00
</ span >
</ div >
</ td >
</ tr >
</ tbody >
</ table >
</ div >
<!-- end header part -->
2021-12-18 16:36:37 -08:00
<!-- Generated by Doxygen 1.9.1 -->
2019-06-22 10:30:09 -07:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
2021-12-18 16:36:37 -08:00
var searchBox = new SearchBox ( "searchBox" , "search" , false , 'Search' , '.html' );
2019-06-22 10:30:09 -07:00
/* @license-end */
</ script >
</ div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" ></ div >
</ div >
</ div >
2022-12-03 00:23:43 +01:00
< div id = "splitbar" style = "-moz-user-select:none;"
2019-06-22 10:30:09 -07:00
class = "ui-resizable-handle" >
</ div >
</ div >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
2021-12-18 16:36:37 -08:00
$ ( document ). ready ( function (){ initNavTree ( 'build.html' , '' ); initResizable (); });
2019-06-22 10:30:09 -07:00
/* @license-end */
</ script >
< div id = "doc-content" >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover = "return searchBox.OnSearchSelectShow()"
onmouseout = "return searchBox.OnSearchSelectHide()"
onkeydown = "return searchBox.OnSearchSelectKey(event)" >
</ div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
2022-12-03 00:23:43 +01:00
< iframe src = "javascript:void(0)" frameborder = "0"
2019-06-22 10:30:09 -07:00
name = "MSearchResults" id = "MSearchResults" >
</ iframe >
</ div >
2019-07-08 17:15:34 -07:00
< div class = "PageDoc" >< div class = "header" >
2019-06-22 10:30:09 -07:00
< div class = "headertitle" >
< div class = "title" > Building </ div > </ div >
</ div > <!--header-->
< div class = "contents" >
2023-03-29 16:10:01 -07:00
< div class = "textblock" >< p > Checkout the sources from GitHub: </ p >< div class = "fragment" >< div class = "line" > git clone https://github.com/microsoft/mimalloc</ div >
2021-12-18 16:36:37 -08:00
</ div > <!-- fragment --> < h2 > Windows</ h2 >
2020-01-16 19:39:14 -08:00
< p > Open < code > ide/vs2019/mimalloc.sln</ code > in Visual Studio 2019 and build (or < code > ide/vs2017/mimalloc.sln</ code > ). The < code > mimalloc</ code > project builds a static library (in < code > out/msvc-x64</ code > ), while the < code > mimalloc-override</ code > project builds a DLL for overriding malloc in the entire program.</ p >
2019-06-23 15:29:41 +08:00
< h2 > macOS, Linux, BSD, etc.</ h2 >
2019-06-22 10:30:09 -07:00
< p > We use < a href = "https://cmake.org" >< code > cmake</ code ></ a >< sup > 1</ sup > as the build system:</ p >
2021-12-18 16:36:37 -08:00
< div class = "fragment" >< div class = "line" > > mkdir -p out/release</ div >
< div class = "line" > > cd out/release</ div >
< div class = "line" > > cmake ../..</ div >
< div class = "line" > > make</ div >
</ div > <!-- fragment --> < p > This builds the library as a shared (dynamic) library (< code > .so</ code > or < code > .dylib</ code > ), a static library (< code > .a</ code > ), and as a single object file (< code > .o</ code > ).</ p >
2019-06-22 10:30:09 -07:00
< p >< code > > sudo make install</ code > (install the library and header files in < code > /usr/local/lib</ code > and < code > /usr/local/include</ code > )</ p >
< p > You can build the debug version which does many internal checks and maintains detailed statistics as:</ p >
2021-12-18 16:36:37 -08:00
< div class = "fragment" >< div class = "line" > > mkdir -p out/debug</ div >
< div class = "line" > > cd out/debug</ div >
< div class = "line" > > cmake -DCMAKE_BUILD_TYPE=Debug ../..</ div >
< div class = "line" > > make</ div >
</ div > <!-- fragment --> < p > This will name the shared library as < code > libmimalloc-debug.so</ code > .</ p >
< p > Finally, you can build a < em > secure</ em > version that uses guard pages, encrypted free lists, etc, as: </ p >< div class = "fragment" >< div class = "line" > > mkdir -p out/secure</ div >
< div class = "line" > > cd out/secure</ div >
< div class = "line" > > cmake -DMI_SECURE=ON ../..</ div >
< div class = "line" > > make</ div >
</ div > <!-- fragment --> < p > This will name the shared library as < code > libmimalloc-secure.so</ code > . Use < code > ccmake</ code >< sup > 2</ sup > instead of < code > cmake</ code > to see and customize all the available build options.</ p >
2019-06-22 10:30:09 -07:00
< p > Notes:</ p >< ol type = "1" >
< li > Install CMake: < code > sudo apt-get install cmake</ code ></ li >
< li > Install CCMake: < code > sudo apt-get install cmake-curses-gui</ code > </ li >
</ ol >
2021-12-18 16:36:37 -08:00
</ div ></ div > <!-- contents -->
</ div > <!-- PageDoc -->
2019-06-22 10:30:09 -07:00
</ div > <!-- doc-content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
2021-12-18 16:36:37 -08:00
< li class = "footer" > Generated by < a href = "https://www.doxygen.org/index.html" >< img class = "footer" src = "doxygen.svg" width = "104" height = "31" alt = "doxygen" /></ a > 1.9.1 </ li >
2019-06-22 10:30:09 -07:00
</ ul >
</ div >
</ body >
</ html >