Well, the buffer is already "dynamicaly allocating." It just won't allocate any one person with more than 32 kb. This works perfectly well on a stock MUD. I had to increase it because occasionally, builders who make exhuberant use of color codes will push a screen of data (such as with olist or rlist) above this number.
Personally I'm wondering about flushing the buffer when an overrun happens, the way stdio does. Has anyone attempted this? --Palrich. ----- Original Message ----- From: "Davion Kalhen" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, December 10, 2003 6:27 AM Subject: Re: rlist > Umm, wouldn't, to avoid ferther problems in the future with such things, why > not implimient a dynamicly allocating buffer. It'll take a bit more cpu, but > peh, way more worth it in the long run? I havn't really looked into the > buffer much, but I may soon... > > Davion > > > >From: "Michael Barton" <[EMAIL PROTECTED]> > >To: "Sarix" <[EMAIL PROTECTED]>, <[email protected]> > >Subject: Re: rlist > >Date: Wed, 10 Dec 2003 05:05:43 -0600 > > > >You also want to look at this in comm.c: > > > > if (d->outsize >= 32000) > > { > > bug("Buffer overflow. Closing.\n\r",0); > > close_socket(d); > > return; > > } > > > >I have bugs echo'd on a wiznet channel. > >One time this bug happened to me, and the bug message was appended to my > >buffer, which caused it to overflow more, which caused this bug message to > >be appended to my buffer, which caused it to overflow more, which.... > >eventually caused me to run out of stack space. > >It was pretty funny. > >I guess you had to be there. > > > >Oh and the -64 isn't necessary. The basic idea is that by using powers of > >2 > >(or actually numbers evenly divisible by the page size on your machine, > >which is almost invariably a power of 2), your block of memory will cause > >fewer page faults. > >But since you're on a modern computer you probably don't have to worry > >about > >page files anyway. > >--Palrich. > > > >----- Original Message ----- > >From: "Sarix" <[EMAIL PROTECTED]> > >To: <[email protected]> > >Sent: Wednesday, December 10, 2003 12:19 AM > >Subject: Re: rlist > > > > > > > Sorry I'll alaborate a little more you should have this in your code: > > > void * rgFreeList [MAX_MEM_LIST]; > > > const int rgSizeList [MAX_MEM_LIST] = > > > { > > > 16, 32, 64, 128, 256, 1024, 2048, 4096, 8192, 16384, 32768-64, > >65536-64 > > > }; > > > > > > Now some muds I've seen stop at 16384 and others 32768. All you need to > >do > > > is take the last number in yours times it by 2 and add 1 to > >MAX_MEM_LIST. > > > This should all be in merc.h I belive. I don't think you need that -64 > >on > > > there, but I left it on my just to be safe. > > > > > > ----- Original Message ----- > > > From: "Nicholas Hutzell" <[EMAIL PROTECTED]> > > > To: <[email protected]> > > > Sent: Tuesday, December 09, 2003 7:04 PM > > > Subject: rlist > > > > > > > > > > I am having a problem with rlist only showing 639 > > > > vnums total. I tried adding to the char buf to see if > > > > it would allow for the extra vnums being used but > > > > nothing seems to work after the 639 vnum. What i did > > > > was.. > > > > > > > > REDIT (redit_rlist) > > > > { > > > > ROOM_INDEX_DATA *pRoomIndex; > > > > AREA_DATA *pArea; > > > > char buf[MAX_STRING_LENGTH + 5000]; <--this > > > > BUFFER *buf1; > > > > char arg[MAX_INPUT_LENGTH]; > > > > bool found; > > > > long vnum; > > > > int col = 0; > > > > > > > > one_argument (argument, arg); > > > > > > > > pArea = ch->in_room->area; > > > > buf1 = new_buf (); > > > > /* buf1[0] = '\0'; */ > > > > found = FALSE; > > > > > > > > for (vnum = pArea->min_vnum; vnum <= > > > > pArea->max_vnum; vnum++) > > > > { > > > > if ((pRoomIndex = get_room_index (vnum))) > > > > { > > > > found = TRUE; > > > > sprintf (buf, "[%5ld] %-17.16s", > > > > vnum, capitalize > > > > (pRoomIndex->name)); > > > > add_buf (buf1, buf); > > > > if (++col % 3 == 0) > > > > add_buf (buf1, "\n\r"); > > > > } > > > > } > > > > > > > > if (!found) > > > > { > > > > send_to_char ("Room(s) not found in this > > > > area.\n\r", ch); > > > > return FALSE; > > > > } > > > > > > > > if (col % 3 != 0) > > > > add_buf (buf1, "\n\r"); > > > > > > > > page_to_char (buf_string (buf1), ch); > > > > free_buf (buf1); > > > > return FALSE; > > > > } > > > > > > > > > > > > but that didnt seem to help any. Does anyone have any > > > > idea how to correct this problem? > > > > > > > > __________________________________ > > > > Do you Yahoo!? > > > > New Yahoo! Photos - easier uploading and sharing. > > > > http://photos.yahoo.com/ > > > > > > > > -- > > > > ROM mailing list > > > > [email protected] > > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom > > > > > > > > > > > > > -- > > > ROM mailing list > > > [email protected] > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom > > > > > >-- > >ROM mailing list > >[email protected] > >http://www.rom.org/cgi-bin/mailman/listinfo/rom > > _________________________________________________________________ > Protect your PC - get McAfee.com VirusScan Online > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom

