> What is the content of the header file?

File GarbageObj.h:
====================

#import <Foundation/Foundation.h>

@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.)
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to