delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

We are yet to call regfree in the startup process to free memory allocated by regcomp. I guess issues will be there also since it did not work in my test program. Good old segmentation fault.
Read somewhere on the net that we cant copy regex_t since its an opaque and cant just copy it.
Any suggestions friends?


Hi,
I am trying to create a map in C++ which will have the regular expression and the corresponding compiled regular form returned by regcomp. It will be something like this:
map <string, regex_t> my_var;
In the startup process we read the regular expressions and store corresponding regex_t variable value in the map. regex_t variable is something like this:
regex_t re;
reslt = regcomp(&re, regex_string, REG_EXTENDED|REG_NOSUB);
then we do:
my_var[regex_string]=re;
.
In other file we use this map to read the re and pass it on to regexec.
It compiles well. But on running we get coredump.
We are yet to call regfree in the startup process to free memory allocated by regcomp. I guess issues will be there also since it did not work in my test program. Good old segmentation fault.
Read somewhere on the net that we cant copy regex_t since its an opaque and cant just copy it.
Any suggestions friends?

TOP

What is your regex question?



We are yet to call regfree in the startup process to free memory allocated by regcomp. I guess issues will be there also since it did not work in my test program. Good old segmentation fault.
Read somewhere on the net that we cant copy regex_t since its an opaque and cant just copy it.
Any suggestions friends?

TOP

Back Forum