swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dropping a Zone


From: Marcus G. Daniels
Subject: Re: dropping a Zone
Date: 24 Mar 2000 15:40:40 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "SJ" == Steve Jackson <address@hidden> writes:

SJ> is mapAllocations is the Zone protocol?

It's in Zone.h, but not in the protocol.  But I guess if you need it..

#import <simtools.h>
#import <defobj.h>
#import <defobj/Create.h>
#import <defobj/defalloc.h> // mapAlloc

#define SIZE 20

@interface MyObject: CreateDrop
{
  void *block;
}
+ createBegin: aZone;
- (void)mapAllocations: (mapalloc_t)mapalloc;
@end

@implementation MyObject
+ createBegin: aZone
{
  MyObject *obj = [super createBegin: aZone];

  obj->block = [aZone allocBlock: SIZE];
  setMappedAlloc (obj);
  return obj;
}

- (void)mapAllocations: (mapalloc_t)mapalloc
{
  mapalloc->size = SIZE;
  mapAlloc (mapalloc, block);
}
@end

int
main (int argc, const char **argv)
{
  initSwarmBatch (argc, argv);
  
  {
    id aZone = [Zone create: globalZone];

    [MyObject create: aZone];
    [aZone drop];
  }
}

/*
Local Variables:
compile-command: "$SWARMHOME/bin/libtool-swarm --mode=link gcc 
-DAPPNAME=zoneDemo -o zoneDemo -g -Wno-import -I$SWARMHOME/include/swarm 
-L$SWARMHOME/lib/swarm zoneDemo.m -lswarm -lobjc"
End:
*/


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]