Fix Fiber::LocalData leak for large fiber locals
[folly.git] / folly / fibers / Fiber.h
index c43894f2e262c9e96b9dd2e32a4dab6004f5f35a..36af25ebb0862c2636480c61d96fc7c62c3d4352 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ class Fiber {
   template <typename F, typename G>
   void setFunctionFinally(F&& func, G&& finally);
 
-  void fiberFunc();
+  [[noreturn]] void fiberFunc();
 
   /**
    * Switch out of fiber context into the main context,
@@ -131,6 +131,7 @@ class Fiber {
   class LocalData {
    public:
     LocalData() {}
+    ~LocalData();
     LocalData(const LocalData& other);
     LocalData& operator=(const LocalData& other);