mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
76078f2c84
myisam/ftdefs.h: intermediate cleanup checkin myisam/mi_create.c: intermediate cleanup checkin myisam/myisamchk.c: intermediate cleanup checkin myisam/ft_parser.c: intermediate cleanup checkin myisam/ft_update.c: intermediate cleanup checkin myisam/mi_update.c: intermediate cleanup checkin mysql-test/r/fulltext.result: stopword test mysql-test/t/fulltext.test: stopword test mysys/mulalloc.c: function comments clarified include/my_handler.h: get_key_length_rdonly utility macro include/myisam.h: this kind of hacks bites :) myisam/ft_dump.c: bugfix myisam/mi_open.c: bugfix myisam/sort.c: bugfixing myisam/mi_rnext.c: not a solution at all, but a temporary fix to make mi_rnext to work on ft2 index. (only ft_dump uses mi_rnext on fulltext indexes for now). myisam/ft_boolean_search.c: ft_sintXkorr, ft_intXstore myisam/ft_nlq_search.c: ft_sintXkorr, ft_intXstore myisam/fulltext.h: ft_sintXkorr, ft_intXstore myisam/mi_check.c: ft_sintXkorr, ft_intXstore myisam/ft_static.c: two-level tree support in wi_write() myisam/mi_write.c: two-level tree support in wi_write() myisam/myisamdef.h: two-level tree support in wi_write() myisam/mi_delete.c: support for ft2 in mi_delete mysql-test/r/fulltext2.result: support for ft2 in mi_delete mysql-test/t/fulltext2.test: support for ft2 in mi_delete
64 lines
1.7 KiB
C
64 lines
1.7 KiB
C
/* Copyright (C) 2000 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
#include "mysys_priv.h"
|
|
#include <stdarg.h>
|
|
|
|
/*
|
|
Malloc many pointers at the same time
|
|
Only ptr1 can be free'd, and doing this will free all
|
|
the memory allocated. ptr2, etc all point inside big allocated
|
|
memory area.
|
|
|
|
SYNOPSIS
|
|
my_multi_malloc()
|
|
myFlags Flags
|
|
ptr1, length1 Multiple arguments terminated by null ptr
|
|
ptr2, length2 ...
|
|
...
|
|
NULL
|
|
*/
|
|
|
|
gptr my_multi_malloc(myf myFlags, ...)
|
|
{
|
|
va_list args;
|
|
char **ptr,*start,*res;
|
|
uint tot_length,length;
|
|
DBUG_ENTER("my_multi_malloc");
|
|
|
|
va_start(args,myFlags);
|
|
tot_length=0;
|
|
while ((ptr=va_arg(args, char **)))
|
|
{
|
|
length=va_arg(args,uint);
|
|
tot_length+=ALIGN_SIZE(length);
|
|
}
|
|
va_end(args);
|
|
|
|
if (!(start=(char *) my_malloc(tot_length,myFlags)))
|
|
DBUG_RETURN(0); /* purecov: inspected */
|
|
|
|
va_start(args,myFlags);
|
|
res=start;
|
|
while ((ptr=va_arg(args, char **)))
|
|
{
|
|
*ptr=res;
|
|
length=va_arg(args,uint);
|
|
res+=ALIGN_SIZE(length);
|
|
}
|
|
va_end(args);
|
|
DBUG_RETURN((gptr) start);
|
|
}
|