Commits

Igor Baidiuk committed 11839a7

Added context variable to allocator function for future use

Comments (0)

Files changed (2)

 	return 0;
 }
 
-void* allocate_storage(size_t size)
+void* allocate_storage(void* context, size_t size)
 {
 	return new char[size];
 }
 extern "C" {
 #endif
     int   luaopen_channels(lua_State* L);
-    void* allocate_storage(size_t size);
+    void* allocate_storage(void* context, size_t size);
 #ifdef __cplusplus
 }
 
 		case LUA_TUSERDATA:
 			{
 				Marshaller marshaller;
-				void* storage = allocate_storage(marshaller.size());
+				void* storage = allocate_storage(lua_touserdata(L, 2), marshaller.size());
 				void* ud = lua_touserdata(L, 1);
 				
 				marshaller.transfer(ud, storage);