git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge branch 'master' into faster-primitives
commit1e53e82d0459b81e160f7caf4fd32fb2c9412406 authorAndy Arvanitis <andyarvanitis@gmail.com> dateSat 26 Jan 2019, 09:56 (8 years ago) parentbad1d54fab29cb
2 files changed+8−8
runtime/purescript.h+6−6 src/CodeGen/Cpp.hs+2−2
runtime/purescript.h+6−6
@@ -150,12 +150,12 @@ namespace purescript {
150150
151151 }; // class boxed::weak
152152
153− class ref {
153+ class recur {
154154 std::shared_ptr<boxed> sptr;
155155 std::shared_ptr<boxed::weak> wptr;
156156
157157 public:
158− ref() : sptr(std::make_shared<boxed>())
158+ recur() : sptr(std::make_shared<boxed>())
159159 , wptr(std::make_shared<boxed::weak>(*sptr)) {}
160160
161161 operator const boxed&() const {
@@ -175,7 +175,7 @@ namespace purescript {
175175 }
176176
177177 template <typename T>
178− auto operator=(T&& right) -> ref& {
178+ auto operator=(T&& right) -> recur& {
179179 *sptr = std::forward<T>(right);
180180 *wptr = *sptr;
181181 return *this;
@@ -184,7 +184,7 @@ namespace purescript {
184184 class weak {
185185 std::shared_ptr<boxed::weak> wptr;
186186 public:
187− weak(const ref& r) : wptr(r.wptr) {}
187+ weak(const recur& r) : wptr(r.wptr) {}
188188
189189 operator boxed() const {
190190 return *wptr;
@@ -197,8 +197,8 @@ namespace purescript {
197197 auto operator()(const boxed& arg) const -> boxed {
198198 return static_cast<boxed>(*wptr)(arg);
199199 }
200− }; // class ref::weak
201− }; // class boxed::ref
200+ }; // class recur::weak
201+ }; // class boxed::recur
202202
203203 }; // class boxed
204204
src/CodeGen/Cpp.hs+2−2
@@ -255,10 +255,10 @@ moduleToCpp (Module _ coms mn _ imps _ foreigns decls) _ =
255255 bindersToCpp ss binders vals
256256 valueToCpp (Let _ ds val) = do
257257 let recurs = concatMap getNames $ filter isRec ds
258− recurDs = (\v -> AST.Var Nothing $ "boxed::ref " <> identToCpp v) <$> recurs
258+ recurDs = (\v -> AST.Var Nothing $ "boxed::recur " <> identToCpp v) <$> recurs
259259 recurDsWeak = (\v -> AST.Var
260260 Nothing
261− ("boxed::ref::weak " <> identToCpp v <> unretainedSuffix <> "(" <> identToCpp v <> ")")
261+ ("boxed::recur::weak " <> identToCpp v <> unretainedSuffix <> "(" <> identToCpp v <> ")")
262262 ) <$> recurs
263263 mutualRecurWarning = if any isMutRec $ filter isRec ds
264264 then [AST.Var Nothing "#pragma message(\"Mutually recursive lets will cause retain cycles (memory leaks)\") //"]