From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/263 Path: news.gmane.org!not-for-mail From: JIghtuse Newsgroups: gmane.linux.lib.musl.general Subject: Re: Simple testing task - string functions Date: Sun, 10 Apr 2011 22:25:59 +0700 Message-ID: <4DA1CC07.5000102@gmail.com> References: <20110410044515.GB13185@brightrain.aerifal.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1312595692 11335 80.91.229.12 (6 Aug 2011 01:54:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 6 Aug 2011 01:54:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: envelope-from@hidden Sun Apr 10 19:26:26 2011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; DomainKey-Signature: a=rsa-sha1; c=nofws; User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 In-Reply-To: <20110410044515.GB13185@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:263 Archived-At: I have some questions about my task. I've written a program to test malloc() function of musl. But.. 1. Can I use standart rand() and srand() functions to generate random size of allocated memory chunks, or I must to write another one random number generator? 2. Write a program which loops many times allocating and freeing memory So, when my program must to free memory? If it freeing just after its allocating, it always gets one chunk of memory. And how to define maximum size of memory chunk? I define it as MAX_SIZE / 1000, where MAX_SIZE is a maximum total allocated amount (about 8 * 10^8). Is it correctly? 3. I decided to generate a fragmentation diagram as a .dat file for plotting by gnuplot. Are you satisfied with it, or maybe write it as a simple text file with pseudo-graphic diagram? Thanks. I await your reply. -- Sincerely yours, JIghtuse.