ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/preload.c
(Generate patch)

Comparing ray/src/rt/preload.c (file contents):
Revision 2.17 by greg, Thu Apr 4 18:51:18 2024 UTC vs.
Revision 2.18 by greg, Wed Aug 21 20:42:20 2024 UTC

# Line 19 | Line 19 | static const char      RCSid[] = "$Id$";
19   #include "func.h"
20   #include "bsdf.h"
21  
22 + char    *shm_boundary = NULL;           /* boundary of shared memory */
23  
24 +
25   /* KEEP THIS ROUTINE CONSISTENT WITH THE DIFFERENT OBJECT FUNCTIONS! */
26  
27  
# Line 174 | Line 176 | preload_objs(void)             /* preload object data structures
176                                  /* note that nobjects may change during loop */
177          for (on = 0; on < nobjects; on++)
178                  load_os(objptr(on));
179 + }
180 +
181 +
182 + void
183 + cow_memshare(void)              /* set up copy-on-write memory sharing */
184 + {
185 +        if (shm_boundary != NULL)
186 +                return;                 /* assume we're good */
187 +
188 +        preload_objs();                 /* preload auxiliary data */
189 +                                        /* set shared memory boundary */
190 +        shm_boundary = (char *)malloc(16);
191 +        strcpy(shm_boundary, "SHM_BOUNDARY");
192 + }
193 +
194 +
195 + void
196 + cow_doneshare(void)             /* clear memory sharing boundary */
197 + {
198 +        if (shm_boundary == NULL)
199 +                return;
200 +                                        /* clear shared memory boundary */
201 +        free((void *)shm_boundary);
202 +        shm_boundary = NULL;
203   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines