libmemalloc  v4.0.00
Modern Memory Allocator
Loading...
Searching...
No Matches
block_header_t Struct Reference

Represents the header for a memory block. More...

#include <libmemalloc.h>

Collaboration diagram for block_header_t:

Public Attributes

uintptr_t magic
 
size_t size
 
uint32_t free
 
uint32_t marked
 
const char * var_name
 
const char * file
 
uint64_t line
 
uintptr_t canary
 
struct BlockHeader * next
 
struct BlockHeader * prev
 
struct BlockHeader * fl_next
 
struct BlockHeader * fl_prev
 

Detailed Description

Represents the header for a memory block.

This structure manages metadata for each block within the heap, including size, status, and debugging information.

Fields:
  • magic – Magic number for integrity check
  • size – Total block size (includes header, data, and canary)
  • free – 1 if block is free, 0 if allocated
  • marked – Garbage collector mark flag
  • var_name – Variable name (for debugging)
  • file – Source file of allocation (for debugging)
  • line – Line number of allocation (for debugging)
  • canary – Canary value for buffer-overflow detection
  • next – Pointer to the next block
  • prev – Pointer to the previous block
  • fl_next – Pointer to the next block on free list
  • fl_prev – Pointer to the previous block on free list

Member Data Documentation

◆ canary

uintptr_t block_header_t::canary

Canary value for buffer-overflow detection

◆ file

const char* block_header_t::file

Source file of allocation (for debugging)

◆ fl_next

struct BlockHeader* block_header_t::fl_next

Pointer to the next block on free list

◆ fl_prev

struct BlockHeader* block_header_t::fl_prev

Pointer to the previous block on free list

◆ free

uint32_t block_header_t::free

1 if block is free, 0 if allocated

◆ line

uint64_t block_header_t::line

Line number of allocation (for debugging)

◆ magic

uintptr_t block_header_t::magic

Magic number for integrity check

◆ marked

uint32_t block_header_t::marked

Garbage collector mark flag

◆ next

struct BlockHeader* block_header_t::next

Pointer to the next block

◆ prev

struct BlockHeader* block_header_t::prev

Pointer to the previous block

◆ size

size_t block_header_t::size

Total block size (includes header, data, and canary)

◆ var_name

const char* block_header_t::var_name

Variable name (for debugging)


The documentation for this struct was generated from the following file: