Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Why any line longer than 255 chars is ignored? #48

Open
havocesp opened this issue May 6, 2023 · 3 comments
Open

Why any line longer than 255 chars is ignored? #48

havocesp opened this issue May 6, 2023 · 3 comments

Comments

@havocesp
Copy link

havocesp commented May 6, 2023

One question...

Why any line longer than 255 chars is ignored?

There is any reasonable explanation?

Regards.

@NotoriousRebel
Copy link

Seems to be a very arbitrary constraint but luckily seems easy enough to modify. Might be worth forking and updating this, if I have some time for this down the road might just do that myself if it works.

@havocesp
Copy link
Author

Hi, @NotoriousRebel !

Seems to be a very arbitrary constraint but luckily seems easy enough to modify. Might be worth forking and updating this, if I have some time for this down the road might just do that myself if it works.

I seems to be a little more complicated.

I already have change all limits (including all that you suggest as result of your search link).

Also tried to solve that by changing many other parts of the code, but max chars line limit is still applied o_O

My C Language knowledge is not enough to achieve that goal.

I surrender!

I just achieve to set STDIN as default output file goal, but was a secondary objective so, I you have any other idea, It will be welcome!

Regards.

@nil0x42
Copy link
Owner

nil0x42 commented Jan 26, 2024

Actually it's not completelly arbitrary. On x64, i use a struct which is sizeof(ptr) (64 bits).
So the struct is the pointer to the mmap(), and i store the line size in the 8 most-significant bits, so i half the hash map size, as each entry costs only 8 bytes instead of 16 (due to alignment).
If i remember correctly, more than 8 bits are guaranted to be 0 in an x64 pointer on linux, but i need to have confirmation so i can potentially expand it to 12 (so max line size would be 4095)

If someone has enough sources to ensure than at least 12 MSB are guaranted to be 0, i can update duplicut accordingly.

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

No branches or pull requests

3 participants