From owner-freebsd-questions@FreeBSD.ORG Thu Mar 11 06:53:53 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D063D106566C for ; Thu, 11 Mar 2010 06:53:53 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: from mail-qy0-f183.google.com (mail-qy0-f183.google.com [209.85.221.183]) by mx1.freebsd.org (Postfix) with ESMTP id 88E818FC08 for ; Thu, 11 Mar 2010 06:53:53 +0000 (UTC) Received: by qyk14 with SMTP id 14so4507807qyk.9 for ; Wed, 10 Mar 2010 22:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/nR7WIZlEBcbfIMViMPm1YONugVeNjpZs3XvrkpeKpI=; b=pQY6NlbnZ0YTc05umyDQajLfc1qI6OJycqHFmAc3CQrMyjXE/P1knSbJypjfbxyRiz 8iJXxrJjlDT00Fq8gOMqNSeIuWrJA8QwPfe8rdvzwCQqp42Fc8C8NcjYOSQJfBRksxg/ nTX/eGiEDttJOQ+c3ZiKehyHD8tQMPO1/KI0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RD/GQkQxkpuqkfzPKsXQMthNskRtLHSDA2wMLRp0CGNAlR2hinYFd/NOFevdip3Nni YbhIjA/m6BNggXNceqxGVe6gwJ55vwSKcsPm57YuuqUZ94BYodhVdQmGRqhcWUFzX29j em7BD6PINEJ4vm36uxgNhZRM28dt7Y8g8EUPs= MIME-Version: 1.0 Received: by 10.229.191.75 with SMTP id dl11mr1027831qcb.16.1268290432779; Wed, 10 Mar 2010 22:53:52 -0800 (PST) In-Reply-To: <1268263879.13552.1.camel@btw.pki2.com> References: <560f92641003100100y6490cf3veb53ca0b11a90dcb@mail.gmail.com> <1268263879.13552.1.camel@btw.pki2.com> Date: Wed, 10 Mar 2010 22:53:52 -0800 Message-ID: <560f92641003102253t68d082a4x3d343521cced11ba@mail.gmail.com> From: Nerius Landys To: dg17@penx.com, FreeBSD Mailing List Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: Objective-C 2.0 on FreeBSD; garbage collection, anyone? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 06:53:53 -0000 > What is the content of the header file? File GarbageObj.h: ==================== #import @interface GarbageObj : NSObject { } -(void) foo; @end File GarbageObj.m: ==================== #import "GarbageObj.h" @implementation GarbageObj -(void) foo { } -(void) dealloc { //printf("dealloc\n"); [super dealloc]; } @end File GarbageMain.m: ==================== #import "GarbageObj.h" int main(int argc, const char *argv[]) { int inx = 0; while (YES) { inx++; GarbageObj *obj = [[GarbageObj alloc] init]; [obj foo]; if (inx == 1000000) { inx = 0; sleep(1); } //printf("before release\n"); //[obj release]; //printf("after release\n"); } return 0; } File GNUmakefile: ==================== include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = garbagecollection garbagecollection_HEADERS = GarbageObj.h garbagecollection_OBJC_FILES = GarbageObj.m GarbageMain.m garbagecollection_RESOURCE_FILES = ADDITIONAL_OBJCFLAGS = -fobjc-gc include $(GNUSTEP_MAKEFILES)/application.make (I was building it as a "tool" before but now I tried "app" instead. Same thing really.)