Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: support mimalloc #2135

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

gremat
Copy link
Contributor

@gremat gremat commented Feb 11, 2025

Static override as described by https://microsoft.github.io/mimalloc/overrides.html .

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello gremat! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

I am currently reviewing this pull request. In the meanwhile, I'm providing a summary of the changes for you and other reviewers to quickly understand the changes and the intent behind them. This pull request introduces support for mimalloc as a memory allocator in libyara. It adds a configure option --with-mimalloc to enable mimalloc, ensuring it's not used with jemalloc or tcmalloc simultaneously. It also includes the mimalloc header and overrides the standard memory allocation functions when MIMALLOC is defined.

Highlights

  • Feature: Adds support for mimalloc as a memory allocator.
  • Configuration: Introduces a --with-mimalloc configure option.
  • Conflicts: Prevents simultaneous use of mimalloc with jemalloc or tcmalloc.
  • Implementation: Includes mimalloc header and overrides memory allocation functions when MIMALLOC is defined.

Changelog

  • configure.ac
    • Added AC_ARG_WITH([mimalloc] to enable mimalloc support.
    • Added checks to prevent conflicts with jemalloc and tcmalloc (lines 262-266).
    • Added library check for mimalloc (line 269).
    • Added CFLAGS definition for MIMALLOC (line 271).
  • libyara/mem.c
    • Included mimalloc-override.h when MIMALLOC is defined (lines 115-117).
Using Gemini Code Assist

The guide for Gemini Code Assist can be found on our website. Below are some highlights.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either @gemini-code-assist or /gemini <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Responds in comments when explicitly tagged, both in issue comments and review comments.
Repository Walkthrough /gemini walkthrough Generates a code walkthrough of the underlying repository to best help you get up to speed.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.


Mimalloc's embrace,
A faster memory space,
Code now finds its peace.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

This pull request introduces support for mimalloc as a heap allocator, which is a valuable addition to the project. The changes are relatively small and focused. Here's a review with some suggestions.

@plusvic plusvic merged commit 53642c3 into VirusTotal:master Feb 11, 2025
9 of 10 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants