|
@@ -4747,11 +4747,17 @@ Functions concerning memory issues.
|
|
\begin{funclist}
|
|
\begin{funclist}
|
|
\funcref{Addr}{Return address of variable}
|
|
\funcref{Addr}{Return address of variable}
|
|
\funcref{Assigned}{Check if a pointer is valid}
|
|
\funcref{Assigned}{Check if a pointer is valid}
|
|
|
|
+\funcref{CompareByte}{Compare 2 memory buffers byte per byte}
|
|
|
|
+\funcref{CompareChar}{Compare 2 memory buffers byte per byte}
|
|
|
|
+\funcref{CompareDWord}{Compare 2 memory buffers byte per byte}
|
|
|
|
+\funcref{CompareWord}{Compare 2 memory buffers byte per byte}
|
|
\funcref{CSeg}{Return code segment}
|
|
\funcref{CSeg}{Return code segment}
|
|
\procref{Dispose}{Free dynamically allocated memory}
|
|
\procref{Dispose}{Free dynamically allocated memory}
|
|
\funcref{DSeg}{Return data segment}
|
|
\funcref{DSeg}{Return data segment}
|
|
|
|
+\procref{FillByte}{Fill memory region with 8-bit pattern}
|
|
\procref{Fillchar}{Fill memory region with certain character}
|
|
\procref{Fillchar}{Fill memory region with certain character}
|
|
-\procref{Fillword}{Fill memory region with 16 bit pattern}
|
|
|
|
|
|
+\procref{FillDWord}{Fill memory region with 32-bit pattern}
|
|
|
|
+\procref{Fillword}{Fill memory region with 16-bit pattern}
|
|
\procref{Freemem}{Release allocated memory}
|
|
\procref{Freemem}{Release allocated memory}
|
|
\procref{Getmem}{Allocate new memory}
|
|
\procref{Getmem}{Allocate new memory}
|
|
\procref{GetMemoryManager}{Return current memory manager}
|
|
\procref{GetMemoryManager}{Return current memory manager}
|
|
@@ -5464,6 +5470,27 @@ None.
|
|
|
|
|
|
\FPCexample{ex24}
|
|
\FPCexample{ex24}
|
|
|
|
|
|
|
|
+\begin{procedure}{FillByte}
|
|
|
|
+\Declaration
|
|
|
|
+Procedure FillByte(var X;Count:longint;Value:byte);
|
|
|
|
+\Description
|
|
|
|
+\var{FillByte} fills the memory starting at \var{X} with \var{Count} bytes
|
|
|
|
+with value equal to \var{Value}.
|
|
|
|
+
|
|
|
|
+This is useful for quickly zeroing out a memory location. If you know
|
|
|
|
+that the size of the memory location to be filled out is a multiple of
|
|
|
|
+2 bytes, it is better to use \seep{Fillword}, and if it is a multiple
|
|
|
|
+of 4 bytes it's better to use \seep{FillDWord}, these routines are
|
|
|
|
+optimized for their respective sizes.
|
|
|
|
+
|
|
|
|
+\Errors
|
|
|
|
+No checking on the size of \var{X} is done.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seep{Fillchar}, \seep{FillDWord}, \seep{Fillword}, \seep{Move}
|
|
|
|
+\end{procedure}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex102}
|
|
|
|
+
|
|
\begin{procedure}{Fillchar}
|
|
\begin{procedure}{Fillchar}
|
|
\Declaration
|
|
\Declaration
|
|
Procedure Fillchar (Var X;Count : Longint;Value : char or byte);;
|
|
Procedure Fillchar (Var X;Count : Longint;Value : char or byte);;
|
|
@@ -5475,19 +5502,32 @@ or characters with value equal to \var{Value}.
|
|
\Errors
|
|
\Errors
|
|
No checking on the size of \var{X} is done.
|
|
No checking on the size of \var{X} is done.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
-\seep{Fillword}, \seep{Move}
|
|
|
|
|
|
+\seep{Fillword}, \seep{Move}, \seep{FillByte}, \seep{FillDWord}
|
|
\end{procedure}
|
|
\end{procedure}
|
|
|
|
|
|
\FPCexample{ex25}
|
|
\FPCexample{ex25}
|
|
|
|
|
|
|
|
+\begin{procedure}{FillDWord}
|
|
|
|
+\Declaration
|
|
|
|
+Procedure FillDWord (Var X;Count : Longint;Value : DWord);;
|
|
|
|
+\Description
|
|
|
|
+\var{Fillword} fills the memory starting at \var{X} with \var{Count} DWords
|
|
|
|
+with value equal to \var{Value}. A DWord is 4 bytes in size.
|
|
|
|
+
|
|
|
|
+\Errors
|
|
|
|
+No checking on the size of \var{X} is done.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seep{FillByte}, \seep{Fillchar}, \seep{Fillword}, \seep{Move}
|
|
|
|
+\end{procedure}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex103}
|
|
|
|
+
|
|
\begin{procedure}{Fillword}
|
|
\begin{procedure}{Fillword}
|
|
\Declaration
|
|
\Declaration
|
|
Procedure Fillword (Var X;Count : Longint;Value : Word);;
|
|
Procedure Fillword (Var X;Count : Longint;Value : Word);;
|
|
-
|
|
|
|
\Description
|
|
\Description
|
|
\var{Fillword} fills the memory starting at \var{X} with \var{Count} words
|
|
\var{Fillword} fills the memory starting at \var{X} with \var{Count} words
|
|
-with value equal to \var{Value}.
|
|
|
|
-
|
|
|
|
|
|
+with value equal to \var{Value}. A word is 2 bytes in size.
|
|
\Errors
|
|
\Errors
|
|
No checking on the size of \var{X} is done.
|
|
No checking on the size of \var{X} is done.
|
|
\SeeAlso
|
|
\SeeAlso
|
|
@@ -5678,6 +5718,70 @@ error, if you try to increase \var{X} over its maximum value.
|
|
|
|
|
|
\FPCexample{ex32}
|
|
\FPCexample{ex32}
|
|
|
|
|
|
|
|
+\begin{function}{IndexByte}
|
|
|
|
+\Declaration
|
|
|
|
+function IndexByte(var buf;len:longint;b:byte):longint;
|
|
|
|
+\Description
|
|
|
|
+\var{IndexByte} searches the memory at \var{buf} for maximally \var{len}
|
|
|
|
+positions for the byte \var{b} and returns it's position if it found one.
|
|
|
|
+If \var{b} is not found then -1 is returned.
|
|
|
|
+
|
|
|
|
+The position is zero-based.
|
|
|
|
+\Errors
|
|
|
|
+\var{Buf} and \var{Len} are not checked to see if they are valid values.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seef{IndexChar}, \seef{IndexDWord}, \seef{IndexWord}, \seef{CompareByte}
|
|
|
|
+\end{function}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex105}
|
|
|
|
+
|
|
|
|
+\begin{function}{IndexChar}
|
|
|
|
+\Declaration
|
|
|
|
+function IndexChar(var buf;len:longint;b:char):longint;
|
|
|
|
+\Description
|
|
|
|
+\var{IndexChar} searches the memory at \var{buf} for maximally \var{len}
|
|
|
|
+positions for the character \var{b} and returns it's position if it found one.
|
|
|
|
+If \var{b} is not found then -1 is returned.
|
|
|
|
+
|
|
|
|
+The position is zero-based.
|
|
|
|
+\Errors
|
|
|
|
+\var{Buf} and \var{Len} are not checked to see if they are valid values.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seef{IndexByte}, \seef{IndexDWord}, \seef{IndexWord}, \seef{CompareChar}
|
|
|
|
+\end{function}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex108}
|
|
|
|
+
|
|
|
|
+\begin{function}{IndexDWord}
|
|
|
|
+\Declaration
|
|
|
|
+function IndexDWord(var buf;len:longint;DW:DWord):longint;
|
|
|
|
+\var{IndexChar} searches the memory at \var{buf} for maximally \var{len}
|
|
|
|
+positions for the DWord \var{DW} and returns it's position if it found one.
|
|
|
|
+If \var{DW} is not found then -1 is returned.
|
|
|
|
+
|
|
|
|
+The position is zero-based.
|
|
|
|
+\Errors
|
|
|
|
+\var{Buf} and \var{Len} are not checked to see if they are valid values.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seef{IndexByte}, \seef{IndexChar}, \seef{IndexWord}, \seef{CompareDWord}
|
|
|
|
+\end{function}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex106}
|
|
|
|
+
|
|
|
|
+\begin{function}{IndexWord}
|
|
|
|
+\Declaration
|
|
|
|
+function IndexWord(var buf;len:longint;W:word):longint;
|
|
|
|
+\var{IndexChar} searches the memory at \var{buf} for maximally \var{len}
|
|
|
|
+positions for the Word \var{W} and returns it's position if it found one.
|
|
|
|
+If \var{W} is not found then -1 is returned.
|
|
|
|
+\Errors
|
|
|
|
+\var{Buf} and \var{Len} are not checked to see if they are valid values.
|
|
|
|
+\SeeAlso
|
|
|
|
+\seef{IndexByte}, \seef{IndexDWord}, \seef{IndexChar}, \seef{CompareWord}
|
|
|
|
+\end{function}
|
|
|
|
+
|
|
|
|
+\FPCexample{ex107}
|
|
|
|
+
|
|
\begin{procedure}{Insert}
|
|
\begin{procedure}{Insert}
|
|
\Declaration
|
|
\Declaration
|
|
Procedure Insert (Const Source : String;var S : String;Index : Longint);
|
|
Procedure Insert (Const Source : String;var S : String;Index : Longint);
|
|
@@ -5694,6 +5798,7 @@ None.
|
|
\end{procedure}
|
|
\end{procedure}
|
|
|
|
|
|
\FPCexample{ex33}
|
|
\FPCexample{ex33}
|
|
|
|
+
|
|
\begin{function}{IsMemoryManagerSet}
|
|
\begin{function}{IsMemoryManagerSet}
|
|
\Declaration
|
|
\Declaration
|
|
function IsMemoryManagerSet: Boolean;
|
|
function IsMemoryManagerSet: Boolean;
|