Skip to content

Commit 63e6c0c

Browse files
committed
fbdocs: wiki snapshot 2020.12.31
1 parent 695c3ff commit 63e6c0c

File tree

10 files changed

+28
-34
lines changed

10 files changed

+28
-34
lines changed

doc/manual/cache/CatPgCompOpt.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Command line compiler options for the fbc compiler:
110110
{{fbdoc item="keyword" value="CompilerOptstrip|-strip"}}
111111
- Omit all symbol information from the output file
112112
{{fbdoc item="keyword" value="CompilerOptt|-t < value >"}}
113-
- Set stack size in kbytes (default: 1M)
113+
- Set stack size in kbytes (default: 1 MB or 2 MB)
114114
{{fbdoc item="keyword" value="CompilerOpttarget|-target < platform >"}}
115115
- Set the target platform for cross compilation
116116
{{fbdoc item="keyword" value="CompilerOptv|-v"}}

doc/manual/cache/CompilerCmdLine.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Using the **fbc** command-line.
146146
=={{fbdoc item="keyword" value="CompilerOpts|-s < name >"}}==
147147
Set subsystem (##gui##, ##console##)
148148
=={{fbdoc item="keyword" value="CompilerOptt|-t < value >"}}==
149-
Set stack size in kbytes (default: 1M)
149+
Set stack size in kbytes (default: 1 MB or 2 MB)
150150

151151
{{fbdoc item="section" value="Meta"}}
152152
=={{fbdoc item="keyword" value="CompilerOptoptfile|@< file >"}}==

doc/manual/cache/CompilerFAQ.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
- defining the array with an empty subscript list (using ##[[KeyPgDim|Dim]]##), or
187187
- defining the array with variable subscripts instead of numeric literals, [[KeyPgConst|constants]] or [[KeyPgEnum|enums]] (using ##[[KeyPgDim|Dim]]##), or
188188
- defining the array with ##[[KeyPgRedim|Redim]]##
189-
- reserve more memory for the program stack by using the ##-t## [[CompilerCmdLine|command-line option]] when compiling. The default is ##-t 1024## (kilobytes). Note: it's a bad idea to use very large values here.
189+
- reserve more memory for the program stack by using the ##-t## [[CompilerCmdLine|command-line option]] when compiling. The default is ##-t 1024## (kilobytes) or ##-t 2048## (kilobytes). Note: it's a bad idea to use very large values here.
190190
- create a //static// array by defining the array with ##[[KeyPgStatic|Static]]## rather than ##[[KeyPgDim|Dim]]## (only locally visible, but globally preserved)
191191
- define the array with ##[[KeyPgShared|Shared]]## access using ##[[KeyPgDim|Dim]]## (this makes the array fully global)
192192
- use [[ProPgPointers|Pointers]] and [[CatPgMemory|Memory Functions]] like ##[[KeyPgAllocate|Allocate]]## and ##[[KeyPgDeallocate|Deallocate]]## to manage memory yourself - this is the preferred way for storing big buffers, but not for beginners.

doc/manual/cache/CompilerOptt.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Set stack size in kilobytes
99
Stack size in kilobytes.
1010

1111
{{fbdoc item="desc"}}
12-
The ##-t## compiler option sets the stack size in kilobytes (defaults to 1024 KBytes). The local arrays are created in the stack, so 1MB of stack is not always enough.
12+
The ##-t## compiler option sets the stack size in kilobytes (defaults to 1024 KBytes for 32-bit targets, increased to 2048 KBytes for 64-bit targets if fbc version >= 1.08). The local arrays are created in the stack, so 1 MB or 2 MB of stack is not always enough.
1313

1414
{{fbdoc item="target"}}
1515
- Supported on Windows, Cygwin and DOS only.

doc/manual/cache/FBWiki.wakka

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Hello, and welcome to the ""FreeBASIC"" wiki. ""FreeBASIC"" is free, open source
3131

3232
==How to get involved in FB development==
3333

34-
Getting involved in ""FreeBASIC""'s development isn't hard. You can provide feedback, help improving this wiki or help developing ""FreeBASIC""-related projects. Of course you can also contribute to the ""FreeBASIC"" compiler, by reporting bugs or submitting patches. A good way to get started is to write small patches and submitting them via the patch tracker on ""SourceForge"", or posting them on the forum. Besides the compiler (written in ""FreeBASIC"" itself), there is the runtime library as well as the graphics library (both written in C). Feel free to contact other developers via the forum, the ""##freebasic"" IRC channel on freenode, or the trackers on ""SourceForge"".
35-
34+
Getting involved in ""FreeBASIC""'s development isn't hard. You can provide feedback, help improving this wiki or help developing ""FreeBASIC""-related projects. Of course you can also contribute to the ""FreeBASIC"" compiler, by reporting bugs or submitting patches. A good way to get started is to write small patches and submitting them via the patch tracker on ""SourceForge"", or posting them on the forum. Besides the compiler (written in ""FreeBASIC"" itself), there is the runtime library as well as the graphics library (both written in C). Feel free to contact other developers via the forum, the ""##freebasic"" IRC channel on freenode, or the trackers on ""SourceForge"". [[https://discord.gg/286rSdK|Join the discussion on Discord]]
35+
3636
[[CompilerContacting|How to contact the developers]]
3737
[[CompilerReportingBugs|How to report a bug]]
3838
[[DevToc|FreeBASIC Internals Documentation]]

doc/manual/cache/KeyPgFBArray.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end namespace
101101

102102
##FBARRAY_FLAGS_DIMENSIONS## : a 4 bit field to indicate the number of elements allocated in ##dimTb()##. If fbc can determine at compile time that less than ##FB_MAXDIMENSIONS## are needed to represent the array, then only the number of dimensions needed are allocated in ##dimTb()##.
103103

104-
##FBARRAY_FLAGS_FIXED_DIM## : if this bit is set, indicates that the number of dimensions are are set and are given in ##dimTb()## and must not be changed.
104+
##FBARRAY_FLAGS_FIXED_DIM## : if this bit is set, indicates that the number of dimensions are set and are given in ##dimTb()## and must not be changed.
105105

106106
##FBARRAY_FLAGS_FIXED_LEN## : if this bit is set, indicates that the array data is fixed length and must not be resized or reallocated
107107

doc/manual/cache/KeyPgThreadSelf.wakka

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,30 @@ Sleep
5050
#include "fbthread.bi"
5151

5252
Dim As Any Ptr phandle(1 To 10)
53-
Dim Shared As Any Ptr pmutex0
5453
Dim Shared As Any Ptr pmutex
5554

56-
Sub myThread (Byval p As Any Ptr)
57-
Mutexlock(pmutex0) ' to ensure that ThreadCreate line is completed before accessing the handle value
58-
Dim As Any Ptr phandle1 = *Cptr(Any Ptr Ptr, p)
59-
Mutexunlock(pmutex0)
55+
Sub myThread (ByVal p As Any Ptr)
56+
MutexLock(pmutex) ' to ensure that ThreadCreate line is completed before accessing the handle value
57+
Dim As Any Ptr phandle1 = *CPtr(Any Ptr Ptr, p)
58+
MutexUnlock(pmutex)
6059
Dim As Any Ptr phandle2 = Threadself()
61-
Mutexlock(pmutex)
62-
Print " ThreadCreate: " & phandle1, "ThreadSelf: " & phandle2
63-
Mutexunlock(pmutex)
60+
Print Left(" ThreadCreate: " & phandle1 & Space(18), 36) _
61+
& " ThreadSelf: " & phandle2 ' single print with concatenated string avoids using a mutex
6462
Sleep 100, 1
6563
End Sub
6664

6765
Print "Handles returned from:"
68-
pmutex0 = Mutexcreate()
69-
pmutex = Mutexcreate()
66+
pmutex = MutexCreate()
7067
For I As Integer = 1 To 10
71-
Mutexlock(pmutex0) ' to ensure that ThreadCreate line is completed before thread accesses the handle value
72-
phandle(I) = Threadcreate(@myThread, @phandle(I))
73-
Mutexunlock(pmutex0)
68+
MutexLock(pmutex) ' to ensure that ThreadCreate line is completed before thread accesses the handle value
69+
phandle(I) = ThreadCreate(@myThread, @phandle(I))
70+
MutexUnlock(pmutex)
7471
Next I
7572

7673
For I As Integer = 1 To 10
77-
Threadwait(phandle(I))
74+
ThreadWait(phandle(I))
7875
Next I
79-
Mutexdestroy(pmutex0)
80-
Mutexdestroy(pmutex)
76+
MutexDestroy(pmutex)
8177

8278
Sleep
8379
%%

doc/manual/cache/PrintToc.wakka

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@
832832
[[ProPgCtorsDtors|Constructors and Destructors (basics)]]
833833
[[ProPgMemberProcedures|Member Procedures]]
834834
[[ProPgProperties|Properties]]
835+
[[ProPgVariableLengthData|Variable-length member data]]
835836
[[ProPgMemberAccessRights|Member Access Rights and Encapsulation]]
836837
[[ProPgOperatorOverloading|Operator Overloading]]
837838
[[ProPgTypeIterators|Iterators]]
@@ -875,6 +876,7 @@
875876
[[ProPgMtCriticalSectionsFAQ|Critical Sections FAQ]]
876877

877878
{{fbdoc item="subsect" value="Making Binaries"}}
879+
[[ProPgExecutables|Executables]]
878880
[[ProPgStaticLibraries|Static Libraries]]
879881
[[ProPgSharedLibraries|Shared Libraries (DLLs)]]
880882
[[ProPgProfiling|Profiling]]

doc/manual/cache/ProPgDynamicMemory.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Managing **Dynamic Memory** (Allocation / Deallocation) with **""FreeBASIC""**
1717
If the size of everything must be declared at compile time, the best is try to estimate the maximum size of the variables needed and hope this will be enough.
1818
This is a bad solution for at least third reasons:
1919
**""-""** First, it leads to wasting memory if it is not fully used.
20-
**""-""** Second, most normal variables are allocated in a part of the memory called the stack. The amount of stack memory for a program is usually quite low (1 MB by default). If exceeding this number, the stack overflow will occur, and the program will abort.
20+
**""-""** Second, most normal variables are allocated in a part of the memory called the stack. The amount of stack memory for a program is usually quite low (1 MB or 2 MB by default). If exceeding this number, the stack overflow will occur, and the program will abort.
2121
**""-""** Third, and most importantly, this can lead to artificial limitations and / or overflows. What happens if the required memory becomes greater than the reserved memory (stopping the program, emitting message to user, ...).
2222

2323
Fortunately, these problems are easily solved through the dynamic allocation of memory. Dynamic memory allocation is a way of running programs to request memory from the operating system when needed. This memory does not come from the program's limited stack memory, but it is rather allocated from a much larger memory pool managed by the operating system called heap. On modern machines, the heap can have a size of several gigabytes.

examples/manual/threads/threadsself-handles.bas

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,29 @@
99
#include "fbthread.bi"
1010

1111
Dim As Any Ptr phandle(1 To 10)
12-
Dim Shared As Any Ptr pmutex0
1312
Dim Shared As Any Ptr pmutex
1413

1514
Sub myThread (ByVal p As Any Ptr)
16-
MutexLock(pmutex0) ' to ensure that ThreadCreate line is completed before accessing the handle value
15+
MutexLock(pmutex) ' to ensure that ThreadCreate line is completed before accessing the handle value
1716
Dim As Any Ptr phandle1 = *CPtr(Any Ptr Ptr, p)
18-
MutexUnlock(pmutex0)
19-
Dim As Any Ptr phandle2 = Threadself()
20-
MutexLock(pmutex)
21-
Print " ThreadCreate: " & phandle1, "ThreadSelf: " & phandle2
2217
MutexUnlock(pmutex)
18+
Dim As Any Ptr phandle2 = ThreadSelf()
19+
Print Left(" ThreadCreate: " & phandle1 & Space(18), 36) _
20+
& " ThreadSelf: " & phandle2 ' single print with concatenated string avoids using a mutex
2321
Sleep 100, 1
2422
End Sub
2523

2624
Print "Handles returned from:"
27-
pmutex0 = MutexCreate()
2825
pmutex = MutexCreate()
2926
For I As Integer = 1 To 10
30-
MutexLock(pmutex0) ' to ensure that ThreadCreate line is completed before thread accesses the handle value
27+
MutexLock(pmutex) ' to ensure that ThreadCreate line is completed before thread accesses the handle value
3128
phandle(I) = ThreadCreate(@myThread, @phandle(I))
32-
MutexUnlock(pmutex0)
29+
MutexUnlock(pmutex)
3330
Next I
3431

3532
For I As Integer = 1 To 10
3633
ThreadWait(phandle(I))
3734
Next I
38-
MutexDestroy(pmutex0)
3935
MutexDestroy(pmutex)
4036

4137
Sleep

0 commit comments

Comments
 (0)