diff options
author | Ronan Collobert <ronan@collobert.com> | 2014-04-07 16:34:55 +0400 |
---|---|---|
committer | Ronan Collobert <ronan@collobert.com> | 2014-04-07 16:34:55 +0400 |
commit | c1fd66ff1f8a5bfb0df7ce4b252c47c321370f0c (patch) | |
tree | a306f4608d424f2d0feb18c91fdc0bd63eb22797 /generic | |
parent | 555ab43e76f4be7bfaf9848af5725eeb17041cf1 (diff) |
added option to mmap storage
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Storage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/Storage.c b/generic/Storage.c index dc0678e..66ff742 100644 --- a/generic/Storage.c +++ b/generic/Storage.c @@ -9,7 +9,8 @@ static int torch_Storage_(new)(lua_State *L) { const char *fileName = luaL_checkstring(L, 1); int isShared = luaT_optboolean(L, 2, 0); - storage = THStorage_(newWithMapping)(fileName, isShared); + long size = luaL_optlong(L, 3, 0); + storage = THStorage_(newWithMapping)(fileName, size, isShared); } else if(lua_type(L, 1) == LUA_TTABLE) { |