Ensure all _free() functions do nothing for NULL, and document this.
This commit is contained in:
parent
6be7402551
commit
7fb9eeed8a
@ -1,4 +1,4 @@
|
|||||||
.TH PCRE2API 3 "05 February 2016" "PCRE2 10.22"
|
.TH PCRE2API 3 "06 February 2016" "PCRE2 10.22"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
PCRE2 - Perl-compatible regular expressions (revised API)
|
PCRE2 - Perl-compatible regular expressions (revised API)
|
||||||
.sp
|
.sp
|
||||||
@ -393,9 +393,16 @@ The function \fBpcre2_substitute()\fP can be called to match a pattern and
|
|||||||
return a copy of the subject string with substitutions for parts that were
|
return a copy of the subject string with substitutions for parts that were
|
||||||
matched.
|
matched.
|
||||||
.P
|
.P
|
||||||
|
Functions whose names begin with \fBpcre2_serialize_\fP are used for saving
|
||||||
|
compiled patterns on disc or elsewhere, and reloading them later.
|
||||||
|
.P
|
||||||
Finally, there are functions for finding out information about a compiled
|
Finally, there are functions for finding out information about a compiled
|
||||||
pattern (\fBpcre2_pattern_info()\fP) and about the configuration with which
|
pattern (\fBpcre2_pattern_info()\fP) and about the configuration with which
|
||||||
PCRE2 was built (\fBpcre2_config()\fP).
|
PCRE2 was built (\fBpcre2_config()\fP).
|
||||||
|
.P
|
||||||
|
Functions with names ending with \fB_free()\fP are used for freeing memory
|
||||||
|
blocks of various sorts. In all cases, if one of these functions is called with
|
||||||
|
a NULL argument, it does nothing.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.SH "STRING LENGTHS AND OFFSETS"
|
.SH "STRING LENGTHS AND OFFSETS"
|
||||||
@ -3214,6 +3221,6 @@ Cambridge, England.
|
|||||||
.rs
|
.rs
|
||||||
.sp
|
.sp
|
||||||
.nf
|
.nf
|
||||||
Last updated: 05 February 2016
|
Last updated: 06 February 2016
|
||||||
Copyright (c) 1997-2016 University of Cambridge.
|
Copyright (c) 1997-2016 University of Cambridge.
|
||||||
.fi
|
.fi
|
||||||
|
@ -240,8 +240,11 @@ Returns: nothing
|
|||||||
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
|
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
|
||||||
pcre2_substring_free(PCRE2_UCHAR *string)
|
pcre2_substring_free(PCRE2_UCHAR *string)
|
||||||
{
|
{
|
||||||
pcre2_memctl *memctl = (pcre2_memctl *)((char *)string - sizeof(pcre2_memctl));
|
if (string != NULL)
|
||||||
memctl->free(memctl, memctl->memory_data);
|
{
|
||||||
|
pcre2_memctl *memctl = (pcre2_memctl *)((char *)string - sizeof(pcre2_memctl));
|
||||||
|
memctl->free(memctl, memctl->memory_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -436,8 +439,11 @@ Returns: nothing
|
|||||||
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
|
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
|
||||||
pcre2_substring_list_free(PCRE2_SPTR *list)
|
pcre2_substring_list_free(PCRE2_SPTR *list)
|
||||||
{
|
{
|
||||||
pcre2_memctl *memctl = (pcre2_memctl *)((char *)list - sizeof(pcre2_memctl));
|
if (list != NULL)
|
||||||
memctl->free(memctl, memctl->memory_data);
|
{
|
||||||
|
pcre2_memctl *memctl = (pcre2_memctl *)((char *)list - sizeof(pcre2_memctl));
|
||||||
|
memctl->free(memctl, memctl->memory_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user