diff options
Diffstat (limited to 'storage/innobase/dyn')
-rw-r--r-- | storage/innobase/dyn/Makefile.am | 24 | ||||
-rw-r--r-- | storage/innobase/dyn/dyn0dyn.c | 48 | ||||
-rw-r--r-- | storage/innobase/dyn/makefilewin | 9 |
3 files changed, 81 insertions, 0 deletions
diff --git a/storage/innobase/dyn/Makefile.am b/storage/innobase/dyn/Makefile.am new file mode 100644 index 00000000000..ec33a3c18a9 --- /dev/null +++ b/storage/innobase/dyn/Makefile.am @@ -0,0 +1,24 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# & Innobase Oy +# +# 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 ../include/Makefile.i + +noinst_LIBRARIES = libdyn.a + +libdyn_a_SOURCES = dyn0dyn.c + +EXTRA_PROGRAMS = diff --git a/storage/innobase/dyn/dyn0dyn.c b/storage/innobase/dyn/dyn0dyn.c new file mode 100644 index 00000000000..0afe6eda856 --- /dev/null +++ b/storage/innobase/dyn/dyn0dyn.c @@ -0,0 +1,48 @@ +/****************************************************** +The dynamically allocated array + +(c) 1996 Innobase Oy + +Created 2/5/1996 Heikki Tuuri +*******************************************************/ + +#include "dyn0dyn.h" +#ifdef UNIV_NONINL +#include "dyn0dyn.ic" +#endif + +/**************************************************************** +Adds a new block to a dyn array. */ + +dyn_block_t* +dyn_array_add_block( +/*================*/ + /* out: created block */ + dyn_array_t* arr) /* in: dyn array */ +{ + mem_heap_t* heap; + dyn_block_t* block; + + ut_ad(arr); + ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N); + + if (arr->heap == NULL) { + UT_LIST_INIT(arr->base); + UT_LIST_ADD_FIRST(list, arr->base, arr); + + arr->heap = mem_heap_create(sizeof(dyn_block_t)); + } + + block = dyn_array_get_last_block(arr); + block->used = block->used | DYN_BLOCK_FULL_FLAG; + + heap = arr->heap; + + block = mem_heap_alloc(heap, sizeof(dyn_block_t)); + + block->used = 0; + + UT_LIST_ADD_LAST(list, arr->base, block); + + return(block); +} diff --git a/storage/innobase/dyn/makefilewin b/storage/innobase/dyn/makefilewin new file mode 100644 index 00000000000..71a58a756c1 --- /dev/null +++ b/storage/innobase/dyn/makefilewin @@ -0,0 +1,9 @@ +include ..\include\makefile.i + +dyn.lib: dyn0dyn.obj makefile + lib -out:..\libs\dyn.lib dyn0dyn.obj + +dyn0dyn.obj: dyn0dyn.c + $(CCOM) $(CFL) -c dyn0dyn.c + + |