-
Notifications
You must be signed in to change notification settings - Fork 192
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
Fix scan find #442
Fix scan find #442
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is usage of re2 actually in be20_api
?
@@ -22,7 +22,7 @@ read | |||
|
|||
# Note: openssl no longer required | |||
# Apple's provided flex is 2.6.4, which is the same that is provided by brew | |||
PKGS+="wget libtool autoconf automake libtool libxml2 libewf json-c" | |||
PKGS+="wget libtool autoconf automake libtool libxml2 libewf json-c re2 abseil pkg-config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're requiring pkg-config
, you can add ax_pkg_check_modules.m4
to your m4
directory and then use PKG_CHECK_MODULES()
in configure.ac
to check on the existence/presence of pkg-config-managed packages and gather up their different CFLAGS and LIBS directives into namespaced variables, so you can incorporate those into Makefile.am
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'm in fact using this now. See
https://github.com/simsong/be20_api/blob/0bd6a2a8a72dffcc867cef478a3f84cf306f131f/be20_configure.m4#L31-L40
And you know what? I just spent 8 hours trying to debug this.
feature_recorder &f = sp.named_feature_recorder("find"); | ||
|
||
auto *tbuf = sbuf_t::sbuf_malloc(sp.sbuf->pos0, sp.sbuf->bufsize+1, sp.sbuf->bufsize+1); | ||
memcpy(tbuf->malloc_buf(), sp.sbuf->get_buf(), sp.sbuf->bufsize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you doing the memcpy
solely so you can null-terminate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
@@ -79,33 +117,16 @@ void scan_find(scanner_params &sp) | |||
/* The current regex library treats \0 as the end of a string. | |||
* So we make a copy of the current buffer to search that's one bigger, and the copy has a \0 at the end. | |||
* This is super-wasteful. Does Lightgrep have this problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to answer definitively: no
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
==========================================
+ Coverage 47.96% 48.48% +0.52%
==========================================
Files 112 112
Lines 13390 13167 -223
==========================================
- Hits 6422 6383 -39
+ Misses 6968 6784 -184 ☔ View full report in Codecov by Sentry. |
No description provided.