Skip to content

show alloc mem#6

Merged
tdameros merged 4 commits into
mainfrom
2-show_alloc_mem
Oct 31, 2025
Merged

show alloc mem#6
tdameros merged 4 commits into
mainfrom
2-show_alloc_mem

Conversation

@tdameros

Copy link
Copy Markdown
Owner

No description provided.

@tdameros tdameros linked an issue Oct 26, 2025 that may be closed by this pull request
@tdameros tdameros changed the title style: remove unused 42 headers show alloc mem Oct 31, 2025
@tdameros tdameros requested a review from Copilot October 31, 2025 16:11
@tdameros tdameros marked this pull request as ready for review October 31, 2025 16:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds memory visualization functionality by implementing a show_alloc_mem() function, along with supporting utilities for formatted output. The changes also include code cleanup by removing header comment blocks from multiple files.

  • Implements show_alloc_mem() to display memory allocations across tiny, small, and large zones
  • Adds comprehensive printing utilities for displaying memory ranges, numbers, and hexadecimal addresses
  • Cleans up pointer references by setting them to NULL after removal operations

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils.c New file providing low-level print functions for chars, strings, numbers, and hex formatting
include/utils.h Header file for the new utility print functions
src/malloc.c Implements show_alloc_mem() and adds utils.h import
src/zone.c Adds print_zone() to iterate and print pages in a zone
src/page.c Adds print_page() and find_next_page_in_order() for page printing and traversal
src/chunk.c Adds print_chunk() and find_next_chunk_in_order() for chunk printing and traversal
include/zone.h Declares print_zone() function
include/page.h Declares page printing and ordering functions
include/chunk.h Declares chunk printing and ordering functions
include/malloc.h Adds declarations for free(), realloc(), and show_alloc_mem()
test/realloc.c Adds forward declaration of show_alloc_mem()
src/memory/allocate.c Removes header comment block
src/memory/free.c Removes header comment block
src/memory/reallocate.c Removes header comment block
include/allocation.h Removes header comment block and trailing blank line
include/malloc.h Removes header comment block
include/memory.h Removes header comment block
include/test.h Removes header comment block
Makefile Adds utils.c to the build

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils.c Outdated
print_string(" bytes\n");
}

void print_identation(size_t level) {

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'identation' to 'indentation'.

Suggested change
void print_identation(size_t level) {
void print_indentation(size_t level) {

Copilot uses AI. Check for mistakes.
Comment thread include/utils.h Outdated
void print_unumber(size_t number);
void print_unumber_hexa(size_t number);
void print_range_address(const void *address, size_t size);
void print_identation(size_t level);

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'identation' to 'indentation'.

Suggested change
void print_identation(size_t level);
void print_indentation(size_t level);

Copilot uses AI. Check for mistakes.
@tdameros tdameros merged commit 8989891 into main Oct 31, 2025
1 check passed
@tdameros tdameros deleted the 2-show_alloc_mem branch October 31, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show_alloc_mem

2 participants