Skip to content

feat: implement calloc and reallocarray#7

Merged
tdameros merged 2 commits into
mainfrom
5-additional-allocation-functions
Nov 15, 2025
Merged

feat: implement calloc and reallocarray#7
tdameros merged 2 commits into
mainfrom
5-additional-allocation-functions

Conversation

@tdameros

Copy link
Copy Markdown
Owner

No description provided.

@tdameros tdameros linked an issue Oct 31, 2025 that may be closed by this pull request
@tdameros tdameros requested a review from Copilot October 31, 2025 17:19
@tdameros tdameros marked this pull request as ready for review October 31, 2025 17:19

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 implements custom memory utility functions (ft_memset and ft_memcpy) and adds two standard allocation functions (calloc and reallocarray) to a custom memory allocator implementation.

  • Custom implementations of ft_memset and ft_memcpy added to utils.c
  • New calloc function with overflow protection
  • New reallocarray function with overflow protection
  • Refactored reallocate.c to use the new ft_memcpy utility function

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/utils.c Adds ft_memset and ft_memcpy helper functions
include/utils.h Adds function declarations for the new memory utility functions
src/malloc.c Implements calloc and reallocarray with overflow checks
src/memory/reallocate.c Refactors manual byte copying to use ft_memcpy

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

Comment thread src/malloc.c Outdated
Comment thread src/malloc.c Outdated
Comment thread src/utils.c
Comment thread src/utils.c
Comment thread src/malloc.c Outdated
@tdameros tdameros merged commit b4fb22f into main Nov 15, 2025
1 check passed
@tdameros tdameros deleted the 5-additional-allocation-functions branch November 15, 2025 13:10
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.

additional allocation functions

2 participants