This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: lib run | |
lib: | |
g++ -shared -fPIC -o libhello.so libhello.cpp hello.cpp | |
run: | |
luajit main.lua | |
clean: | |
rm *.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// User-defined global heap prototypes | |
extern void mem_global_init(); | |
extern void mem_global_term(); | |
extern void* mem_global_allocate(size_t size, size_t align); | |
extern void mem_global_deallocate(void* ptr); | |
extern size_t mem_global_get_size(void* ptr); | |
// Actual code | |
#define BREAK() __debugbreak() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
(c) 2012 +++ Filip Stoklas, aka FipS, http://www.4FipS.com +++ | |
THIS CODE IS FREE - LICENSED UNDER THE MIT LICENSE | |
ARTICLE URL: http://forums.4fips.com/viewtopic.php?f=3&t=589 | |
*/ | |
extern "C" { | |
#include <lua.h> | |
#include <lualib.h> |