Skip to content

Conversation

@Kswin01
Copy link
Contributor

@Kswin01 Kswin01 commented Jun 16, 2025

Expose optional setvar_vaddr and page_size setting to the python interface.

@Kswin01 Kswin01 force-pushed the mr_map_options branch 2 times, most recently from 339d7d4 to 56820f6 Compare June 16, 2025 05:50
@Ivan-Velickovic
Copy link
Collaborator

I think a better approach would be to have a Map.create and Map.createWithSetVar or something that takes an allocator instead. Right now you are passing an allocator everywhere but not actually deallocating. 99% of the time we do not need the allocation and so I think it warrants two APIs.


var options: Mr.Options = .{};
if (page_size != null) {
const page_size_enum: Mr.PageSize = switch (page_size.*) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I remember having .fromInt in sdf.zig for this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep missed that, I can switch to using that now. fromInt requires an architecture to be passed, should we change the API for mr_create so that a user can pass in the arch?

@Kswin01
Copy link
Contributor Author

Kswin01 commented Aug 7, 2025

I think a better approach would be to have a Map.create and Map.createWithSetVar or something that takes an allocator instead. Right now you are passing an allocator everywhere but not actually deallocating. 99% of the time we do not need the allocation and so I think it warrants two APIs.

Switched to this implementation

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.

3 participants