From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1056 invoked by alias); 20 Mar 2004 00:52:19 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 988 invoked from network); 20 Mar 2004 00:52:15 -0000 Received: from unknown (HELO sj-ex-02.xambala.local) (216.100.141.193) by sources.redhat.com with SMTP; 20 Mar 2004 00:52:15 -0000 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Subject: RE: memory leak?? Date: Sat, 20 Mar 2004 00:52:00 -0000 Message-ID: <45EC781FB567314B862CEA4CC72ABF0C054090@sj-ex-02.xambala.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "phuong nguyen" To: "Arnett, Don L." , X-SW-Source: 2004/txt/msg00037.txt.bz2 Just a thought pthread_t *poThread; poThread =3D (pthread_t*)calloc(1,sizeof(pthread_t)); pthread_create(poThread,NULL,pvDoSomething,NULL); why not pthread_t poThread; pthread_create(&poThread,NULL,pvDoSomething,NULL); -----Original Message----- From: pthreads-win32-owner@sources.redhat.com on behalf of Arnett, Don L. Sent: Sat 3/20/2004 2:31 AM To: pthreads-win32@sources.redhat.com Cc:=09 Subject: memory leak?? I'm new to using pthreadsWin32. According to the TaskMgr display this prog= ram is using about 28K more memory at the second getchar() than it was at t= he first getchar(). I found a couple of discussions of memory leaks in the= list archives and it usually was a programmer problem, but I don't see wha= t I'm missing. Thanks for any input. #include #include #include void *pvDoSomething(void *poThreadArgs); int main(int argc, char* argv[]) { pthread_t *poThread; getchar(); poThread =3D (pthread_t*)calloc(1,sizeof(pthread_t)); pthread_create(poThread,NULL,pvDoSomething,NULL); pthread_detach(*poThread); =09 free(poThread); getchar(); return 0; } void *pvDoSomething(void *poThreadArgs) { return NULL; }