Revision: 42441
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42441&view=rev
Author:   brlcad
Date:     2011-01-19 08:50:08 +0000 (Wed, 19 Jan 2011)

Log Message:
-----------
move rt_alloc_seg_block from storage.c to db_alloc.c so 
db_alloc_directory_bloc() doesn't get lonely.

Modified Paths:
--------------
    brlcad/trunk/src/librt/db_alloc.c
    brlcad/trunk/src/librt/storage.c

Modified: brlcad/trunk/src/librt/db_alloc.c
===================================================================
--- brlcad/trunk/src/librt/db_alloc.c   2011-01-19 08:49:02 UTC (rev 42440)
+++ brlcad/trunk/src/librt/db_alloc.c   2011-01-19 08:50:08 UTC (rev 42441)
@@ -244,6 +244,31 @@
 }
 
 
+void
+rt_alloc_seg_block(register struct resource *res)
+{
+    register struct seg *sp;
+    size_t bytes;
+
+    RT_CK_RESOURCE(res);
+
+    if (BU_LIST_UNINITIALIZED(&res->re_seg)) {
+       BU_LIST_INIT(&(res->re_seg));
+       bu_ptbl_init(&res->re_seg_blocks, 64, "re_seg_blocks ptbl");
+    }
+    bytes = bu_malloc_len_roundup(64*sizeof(struct seg));
+    sp = (struct seg *)bu_malloc(bytes, "rt_alloc_seg_block()");
+    bu_ptbl_ins(&res->re_seg_blocks, (long *)sp);
+    while (bytes >= sizeof(struct seg)) {
+       sp->l.magic = RT_SEG_MAGIC;
+       BU_LIST_INSERT(&(res->re_seg), &(sp->l));
+       res->re_seglen++;
+       sp++;
+       bytes -= sizeof(struct seg);
+    }
+}
+
+
 /** @} */
 
 /*

Modified: brlcad/trunk/src/librt/storage.c
===================================================================
--- brlcad/trunk/src/librt/storage.c    2011-01-19 08:49:02 UTC (rev 42440)
+++ brlcad/trunk/src/librt/storage.c    2011-01-19 08:50:08 UTC (rev 42441)
@@ -37,40 +37,8 @@
 #include "bu.h"
 
 
-/**
- * R T _ A L L O C _ S E G _ B L O C K
- *
- * This routine is called by the GET_SEG macro when the freelist is
- * exhausted.  Rather than simply getting one additional structure, we
- * get a whole batch, saving overhead.  When this routine is called,
- * the seg resource must already be locked.  malloc() locking is done
- * in bu_malloc.
- */
-void
-rt_alloc_seg_block(register struct resource *res)
-{
-    register struct seg *sp;
-    size_t bytes;
 
-    RT_CK_RESOURCE(res);
 
-    if (BU_LIST_UNINITIALIZED(&res->re_seg)) {
-       BU_LIST_INIT(&(res->re_seg));
-       bu_ptbl_init(&res->re_seg_blocks, 64, "re_seg_blocks ptbl");
-    }
-    bytes = bu_malloc_len_roundup(64*sizeof(struct seg));
-    sp = (struct seg *)bu_malloc(bytes, "rt_alloc_seg_block()");
-    bu_ptbl_ins(&res->re_seg_blocks, (long *)sp);
-    while (bytes >= sizeof(struct seg)) {
-       sp->l.magic = RT_SEG_MAGIC;
-       BU_LIST_INSERT(&(res->re_seg), &(sp->l));
-       res->re_seglen++;
-       sp++;
-       bytes -= sizeof(struct seg);
-    }
-}
-
-
 /*
  * Local Variables:
  * mode: C


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to