-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nats-io/pooling-and-gc
Performance improvements
- Loading branch information
Showing
9 changed files
with
384 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2015 Apcera Inc. All rights reserved. | ||
|
||
|
||
#ifndef GC_H_ | ||
#define GC_H_ | ||
|
||
// This callback implements the specific code to free the given object. | ||
// This is invoked by the garbage collector. | ||
typedef void (*nats_FreeObjectCb)(void *object); | ||
|
||
// This structure should be included as the first field of any object | ||
// that needs to be garbage collected. | ||
typedef struct __natsGCItem | ||
{ | ||
struct __natsGCItem *next; | ||
nats_FreeObjectCb freeCb; | ||
|
||
} natsGCItem; | ||
|
||
// Gives the object to the garbage collector. | ||
// Returns 'true' if the GC takes ownership, 'false' otherwise (in this case, | ||
// the caller is responsible for freeing the object). | ||
bool | ||
natsGC_collect(natsGCItem *item); | ||
|
||
|
||
#endif /* GC_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.