-
Notifications
You must be signed in to change notification settings - Fork 17
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
perl.h:175:16: error: 'my_perl' undeclared #91
Comments
i try to add dTHX to free_embedded_options function , gmake success int free_embedded_options(char ** options_list, int options_count)
{
int i;
dTHX;
for (i= 0; i < options_count; i++)
{
if (options_list[i])
free(options_list[i]);
}
free(options_list);
return 1;
} |
This is incorrect. Memory which is going to be freed by Perl headers file replaces On some systems those functions just calls system's Correct way is to stop using |
though I don't know what you are talking about, replace free to Safefree , gmake success. int free_embedded_options(char ** options_list, int options_count)
{
int i;
for (i= 0; i < options_count; i++)
{
if (options_list[i])
Safefree(options_list[i]);
}
Safefree(options_list);
return 1;
} |
That for allocation of memory |
Will you prepare a proper fix for it? |
Patch for guarding |
Use only Perl's alloc/free functions. Perl redefine C library alloc functions (malloc, realloc, free) to its own memory allocation and therefore it is not safe to use C library functions which allocate memory. Memory allocates by calloc() must be released by free() from C library, but because Perl's redefine free() there is no access to free() from C library. And Perl does not redefine calloc(). See also: perl5-dbi#91
Use only Perl's alloc/free functions. Perl redefines C library alloc functions (malloc, realloc, free) to its own memory allocation and therefore it is not safe to use C library functions which allocate memory. Perl doesn't redefine calloc() so its usage is not safe as far as it allocates using C library memory management but frees with Perl's. See also: perl5-dbi#91
Ok, I did in in pull request #94. Please check. |
git clone https://github.com/pali/DBD-MariaDB.git success |
Ok, therefore it is fixed, closing. |
F:\perl\git\DBD-MariaDB-1.00\DBD-MariaDB-1.00>perl -v
This is perl 5, version 28, subversion 0 (v5.28.0) built for MSWin32-x64-multi-thread
strawberry-perl-5.28.0.1-64bit.msi
The text was updated successfully, but these errors were encountered: