Skip to content

Commit d3a4de1

Browse files
committed
[llbuild3] Flesh out handling of requests in cached task transitions
1 parent 1a227ab commit d3a4de1

File tree

6 files changed

+259
-73
lines changed

6 files changed

+259
-73
lines changed

llbuild.xcodeproj/xcshareddata/xcschemes/llbuild3.xcscheme

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@
5858
ignoresPersistentStateOnLaunch = "NO"
5959
debugDocumentVersioning = "YES"
6060
debugServiceExtension = "internal"
61-
allowLocationSimulation = "YES"
62-
internalIOSLaunchStyle = "3">
61+
allowLocationSimulation = "YES">
6362
</LaunchAction>
6463
<ProfileAction
6564
buildConfiguration = "Release"

products/llbuild3/SwiftAdaptors.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct ExtRule;
8181
struct ExtRuleProvider {
8282
void* ctx;
8383

84-
// FIXME: some method for cleaning up context
84+
void (*releaseFn)(void* ctx);
8585

8686
void (*rulePrefixesFn)(void*, std::vector<LabelPB>*);
8787
void (*artifactPrefixesFn)(void*, std::vector<LabelPB>*);
@@ -131,7 +131,7 @@ struct ExtTask {
131131

132132
bool isInit = false;
133133

134-
// FIXME: some method for cleaning up context
134+
void (*releaseFn)(void* ctx);
135135

136136
void (*producesFn)(void*, std::vector<LabelPB>*);
137137
bool (*computeFn)(void*, ExtTaskInterface, const TaskContextPB*, const TaskInputsPB*, SubtaskResultMap*, TaskNextStatePB*);
@@ -143,7 +143,7 @@ struct ExtRule {
143143
LabelPB name;
144144
SignaturePB signature;
145145

146-
// FIXME: some method for cleaning up context
146+
void (*releaseFn)(void* ctx);
147147

148148
void (*producesFn)(void*, std::vector<LabelPB>*);
149149

@@ -164,7 +164,7 @@ class BuildRef {
164164
struct ExtActionCache {
165165
void* ctx;
166166

167-
// FIXME: cleanup context
167+
void (*releaseFn)(void* ctx);
168168

169169
void (*getFn)(void* ctx, CacheKeyPB key, std::function<void (CacheValuePB, ErrorPB)>);
170170
void (*updateFn)(void*, CacheKeyPB key, CacheValuePB value);

src/llbuild3/ActionCache.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ extension TActionCache {
2020
var extcache = llbuild3.ExtActionCache()
2121
extcache.ctx = Unmanaged.passRetained(self as AnyObject).toOpaque()
2222

23+
extcache.releaseFn = { ctx in
24+
let _ = Unmanaged<AnyObject>.fromOpaque(ctx!).takeRetainedValue()
25+
}
26+
2327
extcache.getFn = { ctx, kpb, handler in
2428
let key: TCacheKey
2529
do {

0 commit comments

Comments
 (0)