talloc: deprecate talloc_set_memlimit()
authorDavid Disseldorp <ddiss@samba.org>
Tue, 16 Oct 2018 17:06:48 +0000 (19:06 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 19 Oct 2018 21:11:26 +0000 (23:11 +0200)
The memlimit functionality was never utilized by Samba. It adds unneeded
complexity, so flag it as deprecated.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/talloc/talloc.h

index 7372df16fe8eb63cdfca5201fa95cf9f6427c0e8..ba3dee8de97a8e657213d167713f8713afb53c14 100644 (file)
@@ -1893,6 +1893,13 @@ void talloc_set_log_fn(void (*log_fn)(const char *message));
  */
 void talloc_set_log_stderr(void);
 
+#ifndef _DEPRECATED_
+#ifdef HAVE___ATTRIBUTE__
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
+#endif
 /**
  * @brief Set a max memory limit for the current context hierarchy
  *       This affects all children of this context and constrain any
@@ -1907,10 +1914,13 @@ void talloc_set_log_stderr(void);
  *       move causes the new parent to exceed its limits. However
  *       any further allocation on that hierarchy will then fail.
  *
+ * @warning talloc memlimit functionality is deprecated. Please
+ *         consider using cgroup memory limits instead.
+ *
  * @param[in]  ctx             The talloc context to set the limit on
  * @param[in]  max_size        The (new) max_size
  */
-int talloc_set_memlimit(const void *ctx, size_t max_size);
+int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
 
 /* @} ******************************************************************/