Repository navigation
Functions Memory
Paul Squires edited this page Oct 19, 2026
·
1 revision
Home › Function Finder › Memory and pointers
The functions to allocate memory, share ownership of objects, grouped by what you want to do. The From column says what a program needs before it can call one:
- built-in: nothing; it is always available.
-
std/memory:#import "std/memory", thenusing memoryto call it by its bare name.
Jump to: Allocate and free memory · Read and write memory by address · Copy, fill and swap memory · Share one object between owners · Reach the object behind a SharedPtr · Refer to an object without keeping it alive
| Function | What it does | From |
|---|---|---|
| Allocate | Reserves a number of bytes and returns a pointer to them, or 0; the bytes are not cleared. | built-in |
| CAllocate | Reserves memory for a number of elements, set to zero, and returns a pointer or 0. | built-in |
| Reallocate | Resizes a block, keeping its contents, and returns the new pointer, or 0 on failure. | built-in |
| Deallocate | Frees memory from Allocate, CAllocate or Reallocate; does nothing for a null pointer. | built-in |
| Function | What it does | From |
|---|---|---|
| Peek | Returns a reference to the value at an address, as a byte or as a given type. | built-in |
| Poke | Writes a value to an address, as a byte or as a given type. | built-in |
| SAdd | Returns a pointer to the characters of a string. | built-in |
| Function | What it does | From |
|---|---|---|
| Fb_Memcopy | Copies a number of bytes between two memory areas that do not overlap. | built-in |
| Fb_Memmove | Copies a number of bytes between two memory areas, even when they overlap. | built-in |
| fb_MemCopyClear | Copies the first bytes of one area into another and sets the rest to zero. | built-in |
| Clear | Sets a number of bytes, starting at a variable, to zero or to a given value. | built-in |
| Swap | Exchanges the values of two variables. | built-in |
| Function | What it does | From |
|---|---|---|
| SharedPtr | Holds an object shared by several owners and destroys it when the last one lets go. | std/memory |
| MakeShared | Creates a default-constructed object and returns the first SharedPtr to it. | std/memory |
| MakeSharedFrom | Creates a copy of a value on the heap and returns a SharedPtr to it. | std/memory |
| SharedPtr.UseCount | Returns how many SharedPtr handles share the object. | std/memory |
| SharedPtr.Reset | Drops this handle's share and leaves it null; the last one out destroys the object. | std/memory |
| Function | What it does | From |
|---|---|---|
| SharedPtr.Ref | Returns a reference to the object; raises an error if the handle is null. | std/memory |
| SharedPtr.Get | Returns the raw pointer to the object, or 0 if null, without adding an owner. | std/memory |
| SharedPtr.IsNull | Returns true if the handle owns no object. | std/memory |
| SpCast | Returns a SharedPtr to a base type that shares ownership with the derived one. | std/memory |
| Function | What it does | From |
|---|---|---|
| WeakPtr | Holds a link to a shared object that does not keep it alive, to break cycles. | std/memory |
| WeakPtr.Lock | Returns a SharedPtr to the object if it still exists, or a null one if not. | std/memory |
| WeakPtr.Expired | Returns true once the object has been destroyed. | std/memory |
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing