aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of23
1 files changed, 18 insertions, 5 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 73d25951..fdae76f2 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -20,7 +20,7 @@ making it ideal for configuration, scripting,
20and rapid prototyping. 20and rapid prototyping.
21 21
22Lua is implemented as a library, written in @emphx{clean C}, 22Lua is implemented as a library, written in @emphx{clean C},
23the common subset of @N{Standard C} and C++. 23the common subset of C and C++.
24The Lua distribution includes a host program called @id{lua}, 24The Lua distribution includes a host program called @id{lua},
25which uses the Lua library to offer a complete, 25which uses the Lua library to offer a complete,
26standalone Lua interpreter, 26standalone Lua interpreter,
@@ -2957,7 +2957,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize,
2957 return realloc(ptr, nsize); 2957 return realloc(ptr, nsize);
2958} 2958}
2959} 2959}
2960Note that @N{Standard C} ensures 2960Note that @N{ISO C} ensures
2961that @T{free(NULL)} has no effect and that 2961that @T{free(NULL)} has no effect and that
2962@T{realloc(NULL,size)} is equivalent to @T{malloc(size)}. 2962@T{realloc(NULL,size)} is equivalent to @T{malloc(size)}.
2963 2963
@@ -3644,7 +3644,8 @@ Other upvalues are initialized with @nil.
3644 3644
3645} 3645}
3646 3646
3647@APIEntry{lua_State *lua_newstate (lua_Alloc f, void *ud);| 3647@APIEntry{lua_State *lua_newstate (lua_Alloc f, void *ud,
3648 unsigned int seed);|
3648@apii{0,0,-} 3649@apii{0,0,-}
3649 3650
3650Creates a new independent state and returns its main thread. 3651Creates a new independent state and returns its main thread.
@@ -3655,6 +3656,8 @@ Lua will do all memory allocation for this state
3655through this function @seeF{lua_Alloc}. 3656through this function @seeF{lua_Alloc}.
3656The second argument, @id{ud}, is an opaque pointer that Lua 3657The second argument, @id{ud}, is an opaque pointer that Lua
3657passes to the allocator in every call. 3658passes to the allocator in every call.
3659The third argument, @id{seed}, is a seed for the hashing of
3660strings when they are used as table keys.
3658 3661
3659} 3662}
3660 3663
@@ -5721,6 +5724,16 @@ it does not run it.
5721 5724
5722} 5725}
5723 5726
5727@APIEntry{unsigned int luaL_makeseed (lua_State *L);|
5728@apii{0,0,-}
5729
5730Returns a value with a weak attempt for randomness.
5731(It produces that value based on the current date and time,
5732the current processor time, and the address of an internal variable,
5733in case the machine has Address Space Layout Randomization.)
5734
5735}
5736
5724 5737
5725@APIEntry{void luaL_newlib (lua_State *L, const luaL_Reg l[]);| 5738@APIEntry{void luaL_newlib (lua_State *L, const luaL_Reg l[]);|
5726@apii{0,1,m} 5739@apii{0,1,m}
@@ -6892,7 +6905,7 @@ including if necessary a path and an extension.
6892@id{funcname} must be the exact name exported by the @N{C library} 6905@id{funcname} must be the exact name exported by the @N{C library}
6893(which may depend on the @N{C compiler} and linker used). 6906(which may depend on the @N{C compiler} and linker used).
6894 6907
6895This function is not supported by @N{Standard C}. 6908This function is not supported by @N{ISO C}.
6896As such, it is only available on some platforms 6909As such, it is only available on some platforms
6897(Windows, Linux, Mac OS X, Solaris, BSD, 6910(Windows, Linux, Mac OS X, Solaris, BSD,
6898plus other Unix systems that support the @id{dlfcn} standard). 6911plus other Unix systems that support the @id{dlfcn} standard).
@@ -8093,7 +8106,7 @@ different sequences of results each time the program runs.
8093 8106
8094When called with at least one argument, 8107When called with at least one argument,
8095the integer parameters @id{x} and @id{y} are 8108the integer parameters @id{x} and @id{y} are
8096joined into a 128-bit @emphx{seed} that 8109joined into a @emphx{seed} that
8097is used to reinitialize the pseudo-random generator; 8110is used to reinitialize the pseudo-random generator;
8098equal seeds produce equal sequences of numbers. 8111equal seeds produce equal sequences of numbers.
8099The default for @id{y} is zero. 8112The default for @id{y} is zero.