comparison src/ralloc.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents 6240c7796c7a
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
1407 points to a file descriptor opened on /dev/zero */ 1407 points to a file descriptor opened on /dev/zero */
1408 1408
1409 static int DEV_ZERO_FD = -1; 1409 static int DEV_ZERO_FD = -1;
1410 1410
1411 1411
1412 /* We actually need a datastructure that can be usefully structured 1412 /* We actually need a data structure that can be usefully structured
1413 based on the VM address, and allows an ~O(1) lookup on an arbitrary 1413 based on the VM address, and allows an ~O(1) lookup on an arbitrary
1414 address, ie a hash-table. Maybe the XEmacs hash table can be 1414 address, i.e. a hash table. Maybe the XEmacs hash table can be
1415 coaxed enough. At the moment, we use lookup on a hash-table to 1415 coaxed enough. At the moment, we use lookup on a hash table to
1416 decide whether to do an O(n) search on the malloced block list. 1416 decide whether to do an O(n) search on the malloced block list.
1417 Addresses are hashed to a bucket modulo MHASH_PRIME */ 1417 Addresses are hashed to a bucket modulo MHASH_PRIME. */
1418 1418
1419 1419
1420 /* We settle for a standard doubly-linked-list. The dynarr type isn't 1420 /* We settle for a standard doubly-linked-list. The dynarr type isn't
1421 very amenable to deletion of items in the middle, so we conjure up 1421 very amenable to deletion of items in the middle, so we conjure up
1422 yet another stupid datastructure. The structure is maintained as a 1422 yet another stupid datastructure. The structure is maintained as a