Skip to content

Conversation

@lemire
Copy link
Member

@lemire lemire commented Oct 8, 2025

fixes #1008

@lemire lemire requested a review from Copilot October 8, 2025 18:58
Copy link

Copilot AI left a comment

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 fixes issue 1008 by adding reparse functionality to the Ada URL library's C API. The solution allows reusing existing memory allocations when parsing multiple URLs, which improves efficiency.

  • Adds ada_reparse and ada_reparse_with_base functions that reuse existing memory
  • Uses placement new and explicit destructor calls for efficient memory management
  • Updates the C header file with proper function declarations and documentation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ada_c.cpp Implements the reparse functions using placement new for memory reuse
include/ada_c.h Adds function declarations and documentation for the new reparse API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@anonrig
Copy link
Member

anonrig commented Oct 8, 2025

I don't think this is needed. One can use url::set_href() to reuse the existing URL for parsing. We don't need a new method

@lemire
Copy link
Member Author

lemire commented Oct 8, 2025

Closing as not needed.

@nikneym
Copy link

nikneym commented Oct 8, 2025

I don't think this is needed. One can use url::set_href() to reuse the existing URL for parsing. We don't need a new method

This seem to be what I'm looking for. Thanks.

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.

C API for reusing same ada_url instance when reparsing

4 participants