~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/dynamic_array.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-07 14:14:58 UTC
  • mfrom: (1112 staging)
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090807141458-qrc3don58s304ore
Merge from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/* Handling of arrays that can grow dynamicly. */
17
17
 
18
 
#include "config.h"
19
 
#include "drizzled/internal/my_sys.h"
20
 
#include "drizzled/internal/m_string.h"
 
18
#include "mysys/mysys_priv.h"
 
19
#include <mystrings/m_string.h>
21
20
 
22
21
#include <algorithm>
23
22
 
24
23
using namespace std;
25
24
 
26
 
namespace drizzled
27
 
{
28
 
 
29
 
static bool allocate_dynamic(DYNAMIC_ARRAY *array, uint32_t max_elements);
30
 
 
31
25
/*
32
26
  Initiate dynamic array
33
27
 
227
221
    true        Allocation of new memory failed
228
222
*/
229
223
 
230
 
static bool allocate_dynamic(DYNAMIC_ARRAY *array, uint32_t max_elements)
 
224
bool allocate_dynamic(DYNAMIC_ARRAY *array, uint32_t max_elements)
231
225
{
232
226
  if (max_elements >= array->max_element)
233
227
  {
305
299
    array->elements=array->max_element=0;
306
300
  }
307
301
}
308
 
 
309
 
} /* namespace drizzled */