Revision: 54562
http://brlcad.svn.sourceforge.net/brlcad/?rev=54562&view=rev
Author: brlcad
Date: 2013-03-08 04:56:00 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
declare and document the new bu_heap_get() and bu_heap_put() functions.
Modified Paths:
--------------
brlcad/trunk/include/bu.h
Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h 2013-03-08 04:32:48 UTC (rev 54561)
+++ brlcad/trunk/include/bu.h 2013-03-08 04:56:00 UTC (rev 54562)
@@ -3854,6 +3854,37 @@
* 0 all is OK;
*/
BU_EXPORT extern int bu_mem_barriercheck();
+
+
+/** OBE, being removed. */
+BU_EXPORT extern void *bu_pool_get(size_t elem_byte_size);
+/** OBE, being removed. */
+BU_EXPORT extern void bu_pool_put(void *ptr, size_t elem_byte_size);
+
+
+/**
+ * really fast heap-based memory allocation intended for "small"
+ * allocation sizes (e.g., single structs).
+ *
+ * the implementation allocates chunks of memory ('pages') in order to
+ * substantially reduce calls to system malloc. it has a nice
+ * property of having O(1) constant time complexity and profiles
+ * significantly faster than system malloc().
+ *
+ * release memory with bu_heap_put() only.
+ */
+BU_EXPORT extern void *bu_heap_get(size_t sz);
+
+/**
+ * counterpart to bu_heap_get() for releasing fast heap-based memory
+ * allocations.
+ *
+ * the implementation may do nothing, relying on free-on-exit, or may
+ * mark deallocations for reuse. pass a NULL pointer and zero size to
+ * force compaction of any unused memory.
+ */
+BU_EXPORT extern void bu_heap_put(void *ptr, size_t sz);
+
/** @} */
/** @addtogroup log */
@@ -6224,12 +6255,6 @@
/** @} file */
-/**
- * Definitions for memory pool "get" and "free" functions.
- */
-BU_EXPORT extern void *bu_pool_get(size_t elem_byte_size);
-BU_EXPORT extern void bu_pool_put(void *ptr, size_t elem_byte_size);
-
/** @file libbu/ctype.c
*
* Routines for checking ctypes.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits