# `./fio-stl/001 header.h`

12 public symbols.

### Macros

#### `FIO_MEM_REALLOC`

```c
#define FIO_MEM_REALLOC(ptr, old_size, new_size, copy_len)   \
  fio_realloc2((ptr), (new_size), (copy_len))
```

Reallocates memory, copying (at least) `copy_len` if necessary.

_Symbol type:_ `macro`

#### `FIO_MEM_FREE`

```c
#define FIO_MEM_FREE(ptr, size) fio_free((ptr))
```

Frees allocated memory.

_Symbol type:_ `macro`

#### `FIO_MEM_REALLOC_IS_SAFE`

```c
#define FIO_MEM_REALLOC_IS_SAFE fio_realloc_is_safe()
```

Set to true of internall allocator is used (memory returned set to zero).

_Symbol type:_ `macro`

#### `FIO_MEM_ALIGNMENT_SIZE`

```c
#define FIO_MEM_ALIGNMENT_SIZE fio_malloc_alignment()
```

Detect allocator allignment dynamically.

_Symbol type:_ `macro`

#### `FIO_MEM_REALLOC_ALIGNED`

```c
#define FIO_MEM_REALLOC_ALIGNED(ptr, old_size, new_size, copy_len, alignment)   \
  ((ptr) = fio_realloc_aligned((ptr), (new_size), (copy_len), (alignment)))
```

Reallocates memory with an alignment requirement, assigning `ptr`.

_Symbol type:_ `macro`

#### `FIO_MEM_ALLOC_SIZE`

```c
#define FIO_MEM_ALLOC_SIZE(size) fio_alloc_size((size))
```

Returns the usable size the allocator reserves for a `size` request.

_Symbol type:_ `macro`

#### `FIO_MEM_FREE_ALIGNED`

```c
#define FIO_MEM_FREE_ALIGNED(ptr, size) fio___aligned_free_fallback((ptr))
```

Frees memory allocated using FIO_MEM_REALLOC_ALIGNED.

_Symbol type:_ `macro`

#### `FIO_MEM_SYS_ALIGN_MAX_LOG`

```c
#define FIO_MEM_SYS_ALIGN_MAX_LOG 21
```

Mirrors the custom allocator's default FIO_MEMORY_SYS_ALLOCATION_SIZE_LOG.

_Symbol type:_ `macro`

#### `FIO_PTR_TAG`

```c
#define FIO_PTR_TAG(p) (p)
```

Supports embedded pointer tagging / untagging for the included types.

Should resolve to a tagged pointer value. i.e.: ((uintptr_t)(p) | 1)

_Symbol type:_ `macro`

#### `FIO_PTR_UNTAG`

```c
#define FIO_PTR_UNTAG(p) (p)
```

Supports embedded pointer tagging / untagging for the included types.

Should resolve to an untagged pointer value. i.e.: ((uintptr_t)(p) | ~1UL)

_Symbol type:_ `macro`

#### `FIO_PTR_TAG_VALIDATE`

```c
#define FIO_PTR_TAG_VALIDATE(ptr) ((ptr) != NULL)
```

If FIO_PTR_TAG_VALIDATE is defined, tagging will be verified before executing
any code.

FIO_PTR_TAG_VALIDATE must fail on NULL pointers.

_Symbol type:_ `macro`

#### `FIO_PTR_TAG_GET_UNTAGGED`

```c
#define FIO_PTR_TAG_GET_UNTAGGED(untagged_type, tagged_ptr)   \
  ((untagged_type *)(FIO_PTR_UNTAG((tagged_ptr))))
```



_Symbol type:_ `macro`

-----------------------------------------------------
