- Timestamp:
- Mar 22, 2010 8:32:26 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/misc.c
r27569 r27571 185 185 LogRel(("NAT: zone(%s) has reached it maximum\n", zone->name)); 186 186 187 187 allocated: 188 188 if (zone->pfInit) 189 189 zone->pfInit(zone->pData, (void *)&it[1], zone->size, M_DONTWAIT); … … 209 209 210 210 uma_zone_t uma_zcreate(PNATState pData, char *name, size_t size, 211 ctor_t ctor, dtor_t dtor, zinit_t init, zfini_t fini, int flags1, int flags2)211 ctor_t ctor, dtor_t dtor, zinit_t init, zfini_t fini, int flags1, int flags2) 212 212 { 213 213 uma_zone_t zone = RTMemAllocZ(sizeof(struct uma_zone) + size); … … 237 237 zone = RTMemAllocZ(sizeof(struct uma_zone)); 238 238 if (zone == NULL) 239 {240 239 return NULL; 241 } 240 242 241 Assert((master && master->pData)); 243 242 zone->magic = ZONE_MAGIC; … … 254 253 return zone; 255 254 } 255 256 256 void uma_zone_set_max(uma_zone_t zone, int max) 257 257 { 258 258 zone->max_items = max; 259 259 } 260 260 261 void uma_zone_set_allocf(uma_zone_t zone, uma_alloc_t pfAlloc) 261 262 { 262 263 zone->pfAlloc = pfAlloc; 263 264 } 265 264 266 void uma_zone_set_freef(uma_zone_t zone, uma_free_t pfFree) 265 267 { … … 278 280 return &it[-1].ref_count; 279 281 } 282 280 283 void *uma_zalloc_arg(uma_zone_t zone, void *args, int how) 281 284 { … … 303 306 if (zone->pfFree == NULL) 304 307 return; 308 305 309 Assert((mem)); 306 310 RTCritSectEnter(&zone->csZone); … … 320 324 RTCritSectLeave(&zone->csZone); 321 325 } 326 322 327 int uma_zone_exhausted_nolock(uma_zone_t zone) 323 328 { 324 329 return 0; 325 330 } 331 326 332 void zone_drain(uma_zone_t zone) 327 333 { … … 389 395 RTMemFree(zone); 390 396 } 397 391 398 void m_fini(PNATState pData) 392 399 {
Note:
See TracChangeset
for help on using the changeset viewer.