## `unloadmod` -- unload a module

#### Introduction

`unloadmod``("modulename")` unloads the dynamic module named `modulename`.

`unloadmod``()` tries to unload all currently loaded dynamic modules.

#### Call(s)

`unloadmod("modulename" <, Force>)`
`unloadmod()`

#### Parameters

`"modulename"` | - | the name of a module: a character string

#### Options

`Force` | - | forces the module manager to unload a static module.

#### Returns

the void object of type `DOM_NULL`.

#### Side Effects

Unloading the machine code of a module does not affect the module domain. Accessing this module domain, the machine code of the corresponding module is reloaded automatically if needed. The function `reset` unloads all dynamic modules.

#### Further Documentation

Dynamic Modules - User's Manual and Programming Guide for MuPAD 1.4, Andreas Sorgatz, Oct 1998, Springer Verlag, Heidelberg, with CD-ROM, ISBN 3-540-65043-1.

#### Related Functions

`external`, `loadmod`, `module::displace`, `module::new`, `unexport`

#### Details

- `unloadmod``("modulename")` unloads the machine code of the module from the MuPAD process and the main memory.
- `unloadmod` produces an error if one tries to unload a static module without using the option Force.
- `unloadmod` is a function of the system kernel.

#### Example 1

Dynamic modules can be unloaded at runtime to save memory resources or to change and re-compile the modules (rapid prototyping).

    >> loadmod("stdmod"): unloadmod():

After unloading, the machine code is reloaded automatically if needed:

    >> stdmod::which("stdmod")

          "/usr/local/mupad/linux/modules/stdmod.mdm"

#### Background

- The kernel functions `external`, `loadmod`, and `unloadmod` provide basic tools for accessing modules. Extended facilities are available with the `module` library.
- When calling a module function after its machine code was unloaded or displaced, the corresponding machine code is reloaded automatically. Here, in contrast to reloading the module using the function `loadmod`, the module domain is not affected.
- Some operating systems do not support unloading machine code at runtime. This, however, does not affect the usability of dynamic modules in any way.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000