/[pcre]/code/trunk/pcretest.c
ViewVC logotype

Diff of /code/trunk/pcretest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 30 by nigel, Sat Feb 24 21:38:53 2007 UTC revision 31 by nigel, Sat Feb 24 21:38:57 2007 UTC
# Line 274  compiled re. */ Line 274  compiled re. */
274    
275  static void *new_malloc(size_t size)  static void *new_malloc(size_t size)
276  {  {
277  if (log_store) fprintf(outfile, "Store size request: %d\n", (int)size);  if (log_store)
278      fprintf(outfile, "Memory allocation request: %d (code space %d)\n",
279        (int)size, (int)size - offsetof(real_pcre, code[0]));
280  return malloc(size);  return malloc(size);
281  }  }
282    
# Line 292  int study_options = 0; Line 294  int study_options = 0;
294  int op = 1;  int op = 1;
295  int timeit = 0;  int timeit = 0;
296  int showinfo = 0;  int showinfo = 0;
297    int showstore = 0;
298  int posix = 0;  int posix = 0;
299  int debug = 0;  int debug = 0;
300  int done = 0;  int done = 0;
# Line 306  outfile = stdout; Line 309  outfile = stdout;
309    
310  while (argc > 1 && argv[op][0] == '-')  while (argc > 1 && argv[op][0] == '-')
311    {    {
312    if (strcmp(argv[op], "-s") == 0) log_store = 1;    if (strcmp(argv[op], "-s") == 0 || strcmp(argv[op], "-m") == 0)
313        showstore = 1;
314    else if (strcmp(argv[op], "-t") == 0) timeit = 1;    else if (strcmp(argv[op], "-t") == 0) timeit = 1;
315    else if (strcmp(argv[op], "-i") == 0) showinfo = 1;    else if (strcmp(argv[op], "-i") == 0) showinfo = 1;
316    else if (strcmp(argv[op], "-d") == 0) showinfo = debug = 1;    else if (strcmp(argv[op], "-d") == 0) showinfo = debug = 1;
# Line 434  while (!done) Line 438  while (!done)
438    
439    options = 0;    options = 0;
440    study_options = 0;    study_options = 0;
441      log_store = showstore;  /* default from command line */
442    
443    while (*pp != 0)    while (*pp != 0)
444      {      {
445      switch (*pp++)      switch (*pp++)
# Line 447  while (!done) Line 453  while (!done)
453        case 'D': do_debug = do_showinfo = 1; break;        case 'D': do_debug = do_showinfo = 1; break;
454        case 'E': options |= PCRE_DOLLAR_ENDONLY; break;        case 'E': options |= PCRE_DOLLAR_ENDONLY; break;
455        case 'I': do_showinfo = 1; break;        case 'I': do_showinfo = 1; break;
456          case 'M': log_store = 1; break;
457        case 'P': do_posix = 1; break;        case 'P': do_posix = 1; break;
458        case 'S': do_study = 1; break;        case 'S': do_study = 1; break;
459        case 'U': options |= PCRE_UNGREEDY; break;        case 'U': options |= PCRE_UNGREEDY; break;

Legend:
Removed from v.30  
changed lines
  Added in v.31

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12