#ident "$Id$" /* ----------------------------------------------------------------------- * * * Copyright 2001 H. Peter Anvin - All Rights Reserved * * 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, Inc., 675 Mass Ave, Cambridge MA 02139, * USA; either version 2 of the License, or (at your option) any later * version; incorporated herein by reference. * * ----------------------------------------------------------------------- */ #include #include #include #include #include "lpsm.h" static int testsizes[] = { 265299, 336285, 53234, 44195236, 23108, 360124, 796226, 1311075, 7330, 597660, 6006, 83645, 4324, 2820112, 5911, 461569, 1163094, 247678, 18184, 48348, 2901068, 52441197, 4541251, 2353734, 384583, 1421658, 326213, 7422104, 13100, 21201063, 1159271, 848463, 106239, 15066610, 558764, 599357, 80851, 6630, 11709, 144683, 967341, 17170, 2954603, 1021175, 11821390, 4263889, 7024, 204882, 15737, 31181, 2418369, 11145790, 24366, 163651, 390920, 2287775, 56800676, 31133580, 253023, 11087, 9835735, 4371, 2296700, 15571, }; int main(int argc, char *argv[]) { void *areas[64]; int i; unlink("buddy.dat"); unlink("buddy.log"); if ( !lpsm_init("buddy.dat", "buddy.log") ) { fprintf(stderr, "%s: lpsm_arena_init() failed\n", argv[0]); return 1; } lpsm_checkpoint(0.0, PSMSYNC_WAIT); for ( i = 0 ; i < 64 ; i++ ) { areas[i] = lpsm_malloc(testsizes[i]); printf("Alloc: %8d (0x%08x) bytes at %p\n", testsizes[i], testsizes[i], areas[i]); } lpsm_checkpoint(0.0, PSMSYNC_SYNC); return 0; }