Modules/memory

From MSX Game Library

Revision as of 17:46, 10 January 2024 by Aoineko (talk | contribs) (Created page with "{{MODULE |name=memory |category=Core |dependency1= |dependency2= |dependency3= |sample1=s_sys |sample1_desc= |sample2= |sample2_desc= |sample3= |sample3_desc= }}")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Modules

memory

Code: memory.h

Category: Core

Dependencies: None

Samples:

The memory module lets you perform basic memory operations in an optimized way, and also offers advanced features such as dynamic memory allocation management.

Usage

To use this module, include "memory.h" in your source code, and add "memory" to the modules list (LibModules) in your project's configuration file (project_config.js).


Samples

See module use cases in the sample programs:

Settings

Library configuration (msxgl_config.h):

#define MEM_USE_VALIDATOR			FALSE	// Activate validator to handle invalide input value
#define MEM_USE_FASTCOPY			FALSE	// Add support for fast-copy function (using unrolled-LDI loop)
#define MEM_USE_FASTSET				FALSE	// Add support for fast-set function (using unrolled-LDI loop)
#define MEM_USE_DYNAMIC				TRUE	// Add support for malloc style dynamic allocator
#define MEM_USE_BUILTIN				TRUE	// Use SDCC built-in memcpy and memset function instead of MSXgl ones

Dependencies

Dependency on other modules: None

Documentation