Lines Matching defs:block
194 /* We tag each block with an API ID in order to tag API violations */
844 * Request in bytes Size of allocated block Size class idx
998 typedef uint8_t block;
1002 union { block *_padding;
1004 block *freeblock; /* pool's free list head */
1008 uint szidx; /* block size class index */
1009 uint nextoffset; /* bytes to virgin block */
1025 block* pool_address;
1081 At least one block in the pool is currently allocated, and at least one
1082 block in the pool is not currently allocated (note this implies a pool
1089 If all but one block is currently allocated, a malloc can cause a
1090 transition to the full state. If all but one block is not currently
1097 A free of a block in a full pool puts the pool back in the used state.
1099 that the next allocation for its size class will reuse the freed block.
1115 block is freed, it's inserted at the front of its pool's freeblock list. Note
1118 set up, returning the first such block, and setting pool->freeblock to a
1119 one-block list holding the second such block. This is consistent with that
1120 pymalloc strives at all levels (arena, pool, and block) never to touch a piece
1123 So long as a pool is in the used state, we're certain there *is* a block
1128 block is stored in the pool_header nextoffset member, and the largest value
1142 nextpool and prevpool members. The "- 2*sizeof(block *)" gibberish is
1146 union { block *_padding;
1148 block *freeblock;
1150 each of which consume sizeof(block *) bytes. So what usedpools[i+i] really
1164 #define PTA(x) ((poolp )((uint8_t *)&(usedpools[2*(x)]) - 2*sizeof(block *)))
1449 arena_map_get(block *p, int create)
1514 arena_map_bot_t *n_hi = arena_map_get((block *)arena_base, is_used);
1519 int i3 = MAP_BOT_INDEX((block *)arena_base);
1539 arena_map_bot_t *n_lo = arena_map_get((block *)arena_base_next, is_used);
1554 arena_map_is_used(block *p)
1668 arenaobj->pool_address = (block*)arenaobj->address;
1788 // space for a block. Otherwise, remove this pool from usedpools.
1793 /* There is room for another block. */
1794 pool->freeblock = (block*)pool + pool->nextoffset;
1796 *(block **)(pool->freeblock) = NULL;
1808 /* called when pymalloc_alloc can not allocate a block from usedpool.
1809 * This function takes new pool and allocate a block from it.
1876 (block*)usable_arenas->address +
1885 assert((block*)pool <= (block*)usable_arenas->address +
1907 block *bp;
1921 pool->freeblock = *(block **)bp;
1926 * contain just the second block, and return the first
1927 * block.
1931 bp = (block *)pool + POOL_OVERHEAD;
1935 *(block **)(pool->freeblock) = NULL;
1943 Return NULL if pymalloc failed to allocate the memory block: on bigger
1968 block *bp;
1973 * Pick up the head block of its free list.
1979 if (UNLIKELY((pool->freeblock = *(block **)bp) == NULL)) {
2178 /* If ao were the only arena in the list, the last block would have
2214 /* Free a memory block allocated by pymalloc_alloc().
2216 Return 0 if the block was not allocated by pymalloc_alloc(). */
2235 * the pool had at least the p block outstanding, the pool
2241 block *lastfree = pool->freeblock;
2242 *(block **)p = lastfree;
2243 pool->freeblock = (block *)p;
2318 /* pymalloc is not managing this block.
2321 over this block. However, if we do, we need to copy the valid data
2322 from the C-managed block to one of our blocks, and there's no
2327 C-managed block is "at the end" of allocated VM space, so that a
2329 Instead we punt: let C continue to manage this block. */
2333 /* pymalloc is in charge of this block */
2336 /* The block is staying the same or shrinking.
2339 block to a smaller size class, but it wastes memory not to copy it.
2472 instant at which this block was passed out.
2482 uint8_t *p; /* base address of malloc'ed pad block */
2587 uint8_t *head; /* base address of malloc'ed pad block */
2766 /* Display info to stderr about the memory block at p. */
2777 fprintf(stderr, "Debug memory block at address p=%p:", p);
2843 " The block was made by call #%zu to debug malloc/realloc.\n",
2991 fprintf(out, "Small block threshold = %d, in %u size classes.\n",